if (position + len > length)
throw new IOException("Reading past end of file");
else {
int blockPos = (int) (position & JEIndexOutput.BLOCK_MASK);
while (blockPos + len >= JEIndexOutput.BLOCK_LEN) {
int blockLen = JEIndexOutput.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;
}
}