{
boolean isPriority = false;
RandomAccessWrapper wrapper = openRowFile(isPriority);
try {
RandomAccessStream is = wrapper.getFile();
long blockAddress = blockId & BlockStore.BLOCK_MASK;
if (blockAddress < 0 || _fileSize < blockAddress + length) {
throw new IllegalStateException(L.l("block at 0x{0} is invalid for file {1} (length 0x{2})",
Long.toHexString(blockAddress),
_path,
Long.toHexString(_fileSize)));
}
// System.out.println("READ: " + Long.toHexString(blockAddress));
int readLen = is.read(blockAddress, buffer, offset, length);
if (readLen < 0) {
throw new IllegalStateException("Error reading " + is + " for block " + Long.toHexString(blockAddress) + " result=" + readLen);
}