private ByteBuffer loadPageData(final @NotNull PageImpl pageToLoad) throws IOException {
    if (isClosed()) {
      throw new ClosedStorageException("Storage is already closed");
    }
    if (!pageToLoad.isLoading()) {
      throw new AssertionError("Bug: page must be in LOADING, but " + pageToLoad);
    }
    final long startedAtNs = pageCacheStatistics.startTimestampNs();
    final ByteBuffer pageBuffer = pageCache.allocatePageBuffer(pageSize);
    pageBuffer.order(nativeBytesOrder ? ByteOrder.nativeOrder() : BIG_ENDIAN);
    try {
      executeIdempotentOp(ch -> {
        final int readBytes = ch.read(pageBuffer, pageToLoad.offsetInFile());
        final int bytesActuallyRead = Math.max(0, readBytes);
        if (readBytes < pageSize) {
          fillWithZeroes(pageBuffer, bytesActuallyRead, pageSize);
        }
        pageCacheStatistics.pageRead(bytesActuallyRead, startedAtNs);
        return pageBuffer;
      }, isReadOnly());
    }
    catch (Throwable t) {
      pageCache.reclaimPageBuffer(pageSize, pageBuffer);
      throw t;
    }
    return pageBuffer;
  }
private ByteBuffer loadPageData(final @NotNull PageImpl pageToLoad)