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.ByteBufferbyteBufferSlabprivate intbyteBufferSlabSizeprivate ORBorbprivate booleanuseDirectBuffersprivate static ORBUtilSystemExceptionwrapper
-
Constructor Summary
Constructors Constructor Description ByteBufferPoolImpl(ORB orb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intactiveCount()Get a count of the outstanding allocated DirectByteBuffers.private java.nio.ByteBufferallocateDirectByteBufferSlab()Allocate a DirectByteBuffer slab.java.nio.ByteBuffergetByteBuffer(int size)Return a ByteBuffer of the requested size.java.nio.ByteBufferreAllocate(java.nio.ByteBuffer oldByteBuffer, int minimumSize)Return a newByteBufferof at leastminimumSizeand copy any bytes in theoldByteBufferstarting atoldByteBuffer.position()up tooldByteBuffer.limit()into the returnedByteBuffer.voidreleaseByteBuffer(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:
getByteBufferin interfaceByteBufferPool
-
releaseByteBuffer
public void releaseByteBuffer(java.nio.ByteBuffer buffer)
- Specified by:
releaseByteBufferin 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:
activeCountin interfaceByteBufferPool
-
reAllocate
public java.nio.ByteBuffer reAllocate(java.nio.ByteBuffer oldByteBuffer, int minimumSize)Return a newByteBufferof at leastminimumSizeand copy any bytes in theoldByteBufferstarting atoldByteBuffer.position()up tooldByteBuffer.limit()into the returnedByteBuffer.- Specified by:
reAllocatein 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.
-
-