Class ByteBufferPoolImpl

java.lang.Object
com.sun.corba.ee.impl.transport.ByteBufferPoolImpl
All Implemented Interfaces:
ByteBufferPool

public class ByteBufferPoolImpl extends Object implements ByteBufferPool
  • Field Details

    • wrapper

      private static final ORBUtilSystemException wrapper
    • byteBufferSlab

      private ByteBuffer byteBufferSlab
    • useDirectBuffers

      private final boolean useDirectBuffers
    • byteBufferSlabSize

      private final int byteBufferSlabSize
    • orb

      private final ORB orb
  • Constructor Details

    • ByteBufferPoolImpl

      public ByteBufferPoolImpl(ORB orb)
  • Method Details

    • getByteBuffer

      public ByteBuffer getByteBuffer(int size)
      Return a ByteBuffer of the requested size.
      Specified by:
      getByteBuffer in interface ByteBufferPool
    • releaseByteBuffer

      public void releaseByteBuffer(ByteBuffer buffer)
      Specified by:
      releaseByteBuffer in interface ByteBufferPool
    • activeCount

      public int activeCount()
      Get a count of the outstanding allocated DirectByteBuffers. (Those allocated and have not been returned to the pool).
      Specified by:
      activeCount in interface ByteBufferPool
    • reAllocate

      public ByteBuffer reAllocate(ByteBuffer oldByteBuffer, int minimumSize)
      Return a new ByteBuffer of at least minimumSize and copy any bytes in the oldByteBuffer starting at oldByteBuffer.position() up to oldByteBuffer.limit() into the returned ByteBuffer.
      Specified by:
      reAllocate in interface ByteBufferPool
      Parameters:
      oldByteBuffer - old buffer to take bytes from
      minimumSize - minimum size of Buffer
      Returns:
      the new ByteBuffer
    • allocateDirectByteBufferSlab

      private ByteBuffer allocateDirectByteBufferSlab()
      Allocate a DirectByteBuffer slab.