|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.maverick.nio.ByteBufferPool
This class provides a pool for either direct or non direct ByteBuffers.
| Constructor Summary | |
ByteBufferPool()
Create a default pool of ByteBuffers with 4k capacity |
|
ByteBufferPool(int capacity,
boolean direct)
Create a pool of ByteBuffers. |
|
| Method Summary | |
void |
add(java.nio.ByteBuffer buffer)
Add a buffer back to the pool. |
java.nio.ByteBuffer |
get()
Get a free buffer from the pool. |
int |
getAllocatedBuffers()
Get the number of buffers currently allocated out. |
int |
getCapacity()
Get the capacity of buffers in this pool. |
int |
getFreeBuffers()
Get the number of buffers that are ready to be allocated. |
long |
getTotalMemoryAllocated()
Calculate the total memory allocated by this pool. |
long |
getTotalMemoryInUse()
Calculate the total memory in use by this pool. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ByteBufferPool()
public ByteBufferPool(int capacity,
boolean direct)
capacity - intdirect - boolean| Method Detail |
public int getCapacity()
public int getAllocatedBuffers()
public int getFreeBuffers()
public long getTotalMemoryInUse()
public long getTotalMemoryAllocated()
public java.nio.ByteBuffer get()
public void add(java.nio.ByteBuffer buffer)
buffer - ByteBuffer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||