public final class QuiescentBufferPool extends java.lang.Object implements BufferPool
BufferPool implementation which does no pooling. New instances will be created for each call to allocate.| Modifier and Type | Method and Description |
|---|---|
byte[] |
allocateArray(int size)
Creates a new
byte[] of size. |
java.nio.ByteBuffer |
allocateDirect(int size)
Allocates a direct ByteBuffer of size. |
static BufferPool |
getInstance() |
void |
releaseArray(byte[] buffer)
Does nothing.
|
void |
releaseDirect(java.nio.ByteBuffer buffer)
Aggressively releases native resources associated with buffer.
|
public static BufferPool getInstance()
BufferPool which does no caching/reuse of instances.public byte[] allocateArray(int size)
byte[] of size.allocateArray in interface BufferPoolsize - The minimum size array required. Must be >= 0.byte[] with length of at least size.BufferPool.releaseArray(byte[])public void releaseArray(byte[] buffer)
releaseArray in interface BufferPoolbuffer - Instance to return to pool. Must not be null.
Must not be returned more than 1 time. Must not be used by caller after return.public java.nio.ByteBuffer allocateDirect(int size)
Allocates a direct ByteBuffer of size.allocateDirect in interface BufferPoolsize - The minimum size buffer required. Must be >= 0.ByteBuffer of size or greater capacity.BufferPool.releaseDirect(ByteBuffer),
ByteBuffer.allocateDirect(int)public void releaseDirect(java.nio.ByteBuffer buffer)
releaseDirect in interface BufferPoolbuffer - Instance to return to pool. Must not be null.
Must not be returned more than 1 time. Must not be used by caller after return.