if (position + len > length)
throw new IOException("Reading past end of file");
else
{
int blockPos = (int) (position & DbIndexOutput.BLOCK_MASK);
while (blockPos + len >= DbIndexOutput.BLOCK_LEN) {
int blockLen = DbIndexOutput.BLOCK_LEN - blockPos;
System.arraycopy(block.getData(), blockPos,
b, offset, blockLen);
len -= blockLen;
offset += blockLen;
position += blockLen;
block.seek(position);
block.get(directory);
blockPos = 0;
}
if (len > 0)
{
System.arraycopy(block.getData(), blockPos, b, offset, len);
position += len;
}
}