public class SimpleBufferPool extends java.lang.Object implements BufferPool
Constructor and Description |
---|
SimpleBufferPool(BufferPool parent,
int bufferSize,
int poolSize)
Creates a new instance of SimpleBufferPool
|
SimpleBufferPool(int bufferSize,
int poolSize)
Creates a new instance of SimpleBufferPool
|
public SimpleBufferPool(int bufferSize, int poolSize)
bufferSize
- The Size of ByteBuffer this pool should returnpoolSize
- The maximum number of ByteBuffers to cachepublic SimpleBufferPool(BufferPool parent, int bufferSize, int poolSize)
parent
- The parent pool from which to to fetch/return extra buffers.bufferSize
- The Size of ByteBuffer this pool should return.poolSize
- The maximum number of ByteBuffers to cache.public java.nio.ByteBuffer get(int size)
get
in interface BufferPool
public void put(java.nio.ByteBuffer buf)
put
in interface BufferPool
public void putAll(java.util.List<java.nio.ByteBuffer> list)
putAll
in interface BufferPool