Package com.sun.corba.ee.impl.transport
Class ByteBufferPoolImpl
- java.lang.Object
-
- com.sun.corba.ee.impl.transport.ByteBufferPoolImpl
-
- All Implemented Interfaces:
ByteBufferPool
public class ByteBufferPoolImpl extends java.lang.Object implements ByteBufferPool
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.ByteBuffer
byteBufferSlab
private int
byteBufferSlabSize
private ORB
orb
private boolean
useDirectBuffers
private static ORBUtilSystemException
wrapper
-
Constructor Summary
Constructors Constructor Description ByteBufferPoolImpl(ORB orb)
-
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 newByteBuffer
of at leastminimumSize
and copy any bytes in theoldByteBuffer
starting atoldByteBuffer.position()
up tooldByteBuffer.limit()
into the returnedByteBuffer
.void
releaseByteBuffer(java.nio.ByteBuffer buffer)
-
-
-
Field Detail
-
wrapper
private static final ORBUtilSystemException wrapper
-
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 interfaceByteBufferPool
-
releaseByteBuffer
public void releaseByteBuffer(java.nio.ByteBuffer buffer)
- 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
public java.nio.ByteBuffer reAllocate(java.nio.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
.- Specified by:
reAllocate
in interfaceByteBufferPool
- Parameters:
oldByteBuffer
- old buffer to take bytes fromminimumSize
- minimum size of Buffer- Returns:
- the new ByteBuffer
-
allocateDirectByteBufferSlab
private java.nio.ByteBuffer allocateDirectByteBufferSlab()
Allocate a DirectByteBuffer slab.
-
-