private LogChunkImpl readChunkAt(@NotNull ByteBuffer pageBuffer,
                                   int chunkOffsetInBuffer,
                                   long chunkOffsetInFile) throws IOException {
    int header = LogChunkImpl.readHeader(pageBuffer, chunkOffsetInBuffer);
    if (!LogChunkImpl.isHeaderSet(header)) {
      long chunkId = chunkOffsetToId(chunkOffsetInFile);
      throw new IOException("chunk[" + chunkId + "][@" + chunkOffsetInFile + "].header is not written: " +
                            "(header=" + Integer.toHexString(header) + ") either unfinished or corrupted. " +
                            moreDiagnosticInfo(chunkOffsetInFile) +
                            (ADD_LOG_CONTENT ? "\n" + dumpContentAroundId(chunkId, DEBUG_DUMP_REGION_WIDTH) : "")
      );
    }
    int chunkLength = LogChunkImpl.unpackChunkLength(header);
    boolean isPadding = LogChunkImpl.isPaddingChunk(header);
    boolean hasNextChunkIdField = LogChunkImpl.hasNextChunkIdField(header);
    return new LogChunkImpl(chunkOffsetInFile, pageBuffer, chunkOffsetInBuffer, chunkLength, isPadding, hasNextChunkIdField);
  }
private LogChunkImpl readChunkAt(@NotNull ByteBuffer pageBuffer,
                                   int chunkOffsetInBuffer,
                                   long chunkOffsetInFile)