int (final long offsetInFile) { final int pageIndex = (int)(offsetInFile / pageSize); if (pageIndex < 0) { throw new AssertionError("pageIndex(offset: " + offsetInFile + ") = " + pageIndex + ", but must be >=0"); } return pageIndex; }