| PREV CLASS NEXT CLASS | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.comm.utils.nio
public class ByteBufferPool
| Field Summary |
ByteOrder |
|
private final int |
|
private final ByteOrder |
|
private static Logger |
|
private final long |
|
| Constructor Summary |
public void |
ByteBufferPool(Integer maxBuffers, Integer bufferCapacity, ByteOrder byteOrder) |
| Method Summary |
public synchronized void |
|
protected ByteBuffer |
|
public ByteBuffer |
|
public ByteOrder |
|
public synchronized void |
|
public synchronized String |
|
private final int bufferCapacity
Final.
Multiplicity:
1
ByteOrder byteOrder
private final ByteOrder byteOrder
Final.
Multiplicity:
1
private static Logger logger
Multiplicity:
1
Static.
private final long maxBuffers
Final.
Multiplicity:
1
public void ByteBufferPool (Integer maxBuffers, Integer bufferCapacity, ByteOrder byteOrder)
Creates a new pool with the given properties.
Stereotype:
create
public synchronized void clear ()
Removes all buffers from the pool.
Synchronized.
protected ByteBuffer createBuffer (Integer capacity)
Tries to allocate a direct buffer first, and if it can't,
allocates it from the heap. This method can be overriden in
order to create custom bytebuffers.
public ByteBuffer get ()
Returns a cleared buffer from the pool. No implementation
for now, just plain create a new buffer.
Return:
a buffer from the pool.
public ByteOrder getByteOrder ()
Returns the byte order used when returning buffers.
public synchronized void put (ByteBuffer buffer)
Returns the buffer back to the pool
Parameters:
buffer the buffer to put into the pool.
Synchronized.
public synchronized String toString ()
Returns a summary statistics representation of the receiver.
Synchronized.
| PREV CLASS NEXT CLASS | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|