block = phase.getAVLBlockFilePhase().readBlock(objectPool, nodeId); } catch (IOException ex) { throw new Error("IOException", ex);
/** * Reads data from the specified block into the ByteBuffer starting at the * current position. The number of bytes read is the number of remaining * bytes in the ByteBuffer. */ private ByteBuffer retrieveRemainingBytes( ObjectPool objectPool, ByteBuffer data, long blockId ) throws IOException { int dataSize = data.remaining(); if (dataSize > 0) { // Determine the block file to use. int fileIndex = XAUtils.log2( (dataSize - 1) >> (LOG2_MIN_BLOCK_SIZE - 1) ); ManagedBlockFile.Phase blockFilePhase = blockFilePhases[fileIndex]; Block block = blockFilePhase.readBlock(objectPool, blockId); try { block.get(0, data); } finally { block.release(); } } return data; }