int endOffset;
if (currentBlockIndex == blockIndexReader.getNumEntries() - 1)
// the last block in the block index
endOffset = -1;
else {
ByteRange indexPos = DiskIndex.getBlockEntry(currentBlockIndex + 1, blockIndexReader);
ByteBuffer indexPosBuf = indexPos.getBuf();
endOffset = DiskIndex.getBlockIndexOffset(indexPosBuf, indexPos.getStartOffset());
// is this the last block of the current block file?
// then the endBlockOffset should be set to the end of the
// file
if (DiskIndex.getBlockIndexFileId(indexPosBuf, indexPos.getStartOffset()) > fileId)
endOffset = -1;
// endBlockOffset = getBlockOffset(indexPosition + 1,
// blockIndex);
}