private static @NotNull DirectBufferWrapper allocateAndLoadPage(long pageId, boolean read, PagedFileStorage owner, boolean checkAccess)
    throws IOException {
    if (checkAccess) {
      StorageLockContext context = owner.getStorageLockContext();
      if (read) {
        context.checkReadAccess();
      }
      else {
        context.checkWriteAccess();
      }
    }
    final long offsetInFile = (pageId & MAX_PAGES_COUNT) * owner.getPageSize();

    return new DirectBufferWrapper(owner, offsetInFile);
  }
private static @NotNull DirectBufferWrapper allocateAndLoadPage(long pageId, boolean read, PagedFileStorage owner, boolean checkAccess)