long (int pageNumber) { final int calculatedOffset = (pageNumber + 1) / CHUNKS_PER_SINGLE_OFFSET; long offset = calculatedOffset > 0 ? myChunkOffsetTable[calculatedOffset - 1]:0; final int baseOffset = calculatedOffset * CHUNKS_PER_SINGLE_OFFSET; for(int index = 0, len = (pageNumber + 1) % CHUNKS_PER_SINGLE_OFFSET; index < len; ++index) { offset += myChunkLengthTable[baseOffset + index] & MAX_PAGE_LENGTH; } if (DO_DEBUG_SELF_CHECKS) { assert myCompressedChunksFileOffsets.getLong(pageNumber) == offset; } return offset; }