Package com.sun.corba.ee.impl.transport
Class ByteBufferPoolImpl
java.lang.Object
com.sun.corba.ee.impl.transport.ByteBufferPoolImpl
- All Implemented Interfaces:
ByteBufferPool
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBuffer
private final int
private final ORB
private final boolean
private static final ORBUtilSystemException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get a count of the outstanding allocated DirectByteBuffers.private ByteBuffer
Allocate a DirectByteBuffer slab.getByteBuffer
(int size) Return a ByteBuffer of the requested size.reAllocate
(ByteBuffer oldByteBuffer, int minimumSize) Return a newByteBuffer
of at leastminimumSize
and copy any bytes in theoldByteBuffer
starting atoldByteBuffer.position()
up tooldByteBuffer.limit()
into the returnedByteBuffer
.void
releaseByteBuffer
(ByteBuffer buffer)
-
Field Details
-
wrapper
-
byteBufferSlab
-
useDirectBuffers
private final boolean useDirectBuffers -
byteBufferSlabSize
private final int byteBufferSlabSize -
orb
-
-
Constructor Details
-
ByteBufferPoolImpl
-
-
Method Details
-
getByteBuffer
Return a ByteBuffer of the requested size.- Specified by:
getByteBuffer
in interfaceByteBufferPool
-
releaseByteBuffer
- Specified by:
releaseByteBuffer
in interfaceByteBufferPool
-
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 interfaceByteBufferPool
-
reAllocate
Return a newByteBuffer
of at leastminimumSize
and copy any bytes in theoldByteBuffer
starting atoldByteBuffer.position()
up tooldByteBuffer.limit()
into the returnedByteBuffer
.- Specified by:
reAllocate
in interfaceByteBufferPool
- Parameters:
oldByteBuffer
- old buffer to take bytes fromminimumSize
- minimum size of Buffer- Returns:
- the new ByteBuffer
-
allocateDirectByteBufferSlab
Allocate a DirectByteBuffer slab.
-