public ByteBuffer next() throws IOException {
    int size = sizeIterator.next();
    // TODO: Reuse this buffer
    ByteBuffer buffer = ByteBuffer.allocate(size);
    /*
     Notice, we don't need to flip the buffer after calling
     logStream.readFully, since this function does not change
     the position of the buffer.
    */
    logStream.readFully(buffer.array(), 0, size);
    return buffer;
  }
Like {@link Iterator#next()}.

@throws IOException when failing to read from channel.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALByteBufReader.java