Package org.teiid.common.buffer.impl
Class BlockByteBuffer
- java.lang.Object
-
- org.teiid.common.buffer.impl.BlockByteBuffer
-
public class BlockByteBuffer extends Object
Provides buffer slices or blocks off of a central set of buffers.
-
-
Constructor Summary
Constructors Constructor Description BlockByteBuffer(int segmentAddressBits, int blockCount, int blockAddressBits, boolean direct)
Creates a newBlockByteBuffer
where each buffer segment will be 1 << segmentAddressBits (max of 30), and a total size of (1 << blockAddressBits)*blockCount.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ByteBuffer
allocate(int size, boolean direct)
BlockByteBuffer
duplicate()
ByteBuffer[]
getBuffers()
ByteBuffer
getByteBuffer(int block)
Return a buffer positioned at the given start byte.
-
-
-
Constructor Detail
-
BlockByteBuffer
public BlockByteBuffer(int segmentAddressBits, int blockCount, int blockAddressBits, boolean direct)
Creates a newBlockByteBuffer
where each buffer segment will be 1 << segmentAddressBits (max of 30), and a total size of (1 << blockAddressBits)*blockCount.- Parameters:
segmentAddressBits
-blockCount
-blockAddressBits
-direct
-
-
-
Method Detail
-
getBuffers
public ByteBuffer[] getBuffers()
-
allocate
public static ByteBuffer allocate(int size, boolean direct)
-
duplicate
public BlockByteBuffer duplicate()
-
getByteBuffer
public ByteBuffer getByteBuffer(int block)
Return a buffer positioned at the given start byte. It is assumed that the caller will handle blocks in a thread safe manner.- Parameters:
block
-- Returns:
-
-