@Override
  public synchronized void close() {
    isClosed.set(true);

    try (final ConcurrentIterableLinkedQueue<E>.DynamicIterator iterator =
        queue.iterateFromEarliest()) {
      while (true) {
        final E element = iterator.next(0);
        if (Objects.isNull(element)) {
          break;
        }
        releaseResource(element);
      }
    }
    queue.clear();
  }
Deserialize a single element from byteBuffer.

@param byteBuffer the byteBuffer corresponding to an element
@return The deserialized element or {@code null} if a failure is encountered.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/listening/AbstractSerializableListeningQueue.java