public class BufferPoolChunk extends java.lang.Object implements BufferPool
| Constructor and Description |
|---|
BufferPoolChunk(int inChunkSize,
int inTotalChunks)
Creates a new buffer pool.
|
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
allocBuffer(int minSize)
Returns an empty buffer with at least minSize capacity.
|
java.nio.ByteBuffer |
allocBufferChunk()
Returns an empty buffer with chunkSize capacity.
|
int |
getChunkSize() |
int |
getNumChunks() |
void |
printAllocated()
Print a list of buffers currently allocated.
|
void |
returnBuffer(java.nio.ByteBuffer inBuffer)
Return a buffer to the buffer pool.
|
public BufferPoolChunk(int inChunkSize,
int inTotalChunks)
inChunkSize - - Buffer chunks in increments of this size are allocated.inTotalChunks - - The total number of direct byte buffer chunks.public int getChunkSize()
getChunkSize in interface BufferPoolpublic int getNumChunks()
getNumChunks in interface BufferPoolpublic java.nio.ByteBuffer allocBuffer(int minSize)
BufferPoolallocBuffer in interface BufferPoolminSize - - The minimum size of the returned buffer.public java.nio.ByteBuffer allocBufferChunk()
BufferPoolallocBufferChunk in interface BufferPoolpublic void returnBuffer(java.nio.ByteBuffer inBuffer)
BufferPoolreturnBuffer in interface BufferPoolinBuffer - - The buffer to return to the pool.public void printAllocated()
printAllocated in interface BufferPool