Class BlockByteBuffer


  • public class BlockByteBuffer
    extends Object
    Provides buffer slices or blocks off of a central set of buffers.
    • Constructor Detail

      • BlockByteBuffer

        public BlockByteBuffer​(int segmentAddressBits,
                               int blockCount,
                               int blockAddressBits,
                               boolean direct)
        Creates a new BlockByteBuffer 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

      • allocate

        public static ByteBuffer allocate​(int size,
                                          boolean direct)
      • 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: