Class ByteBufferPoolImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int activeCount()
      Get a count of the outstanding allocated DirectByteBuffers.
      private java.nio.ByteBuffer allocateDirectByteBufferSlab()
      Allocate a DirectByteBuffer slab.
      java.nio.ByteBuffer getByteBuffer​(int size)
      Return a ByteBuffer of the requested size.
      java.nio.ByteBuffer reAllocate​(java.nio.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.
      void releaseByteBuffer​(java.nio.ByteBuffer buffer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • byteBufferSlab

        private java.nio.ByteBuffer byteBufferSlab
      • useDirectBuffers

        private final boolean useDirectBuffers
      • byteBufferSlabSize

        private final int byteBufferSlabSize
      • orb

        private final ORB orb
    • Constructor Detail

      • ByteBufferPoolImpl

        public ByteBufferPoolImpl​(ORB orb)
    • Method Detail

      • getByteBuffer

        public java.nio.ByteBuffer getByteBuffer​(int size)
        Return a ByteBuffer of the requested size.
        Specified by:
        getByteBuffer 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 java.nio.ByteBuffer reAllocate​(java.nio.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 java.nio.ByteBuffer allocateDirectByteBufferSlab()
        Allocate a DirectByteBuffer slab.