com.kenai.jaffl.util
Class SimpleBufferPool
java.lang.Object
com.kenai.jaffl.util.SimpleBufferPool
- All Implemented Interfaces:
- BufferPool
public class SimpleBufferPool
- extends java.lang.Object
- implements BufferPool
Constructor Summary |
SimpleBufferPool(BufferPool parent,
int bufferSize,
int poolSize)
Creates a new instance of SimpleBufferPool |
SimpleBufferPool(int bufferSize,
int poolSize)
Creates a new instance of SimpleBufferPool |
Method Summary |
java.nio.ByteBuffer |
get(int size)
|
void |
put(java.nio.ByteBuffer buf)
|
void |
putAll(java.util.List<java.nio.ByteBuffer> list)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleBufferPool
public SimpleBufferPool(int bufferSize,
int poolSize)
- Creates a new instance of SimpleBufferPool
- Parameters:
bufferSize
- The Size of ByteBuffer this pool should returnpoolSize
- The maximum number of ByteBuffers to cache
SimpleBufferPool
public SimpleBufferPool(BufferPool parent,
int bufferSize,
int poolSize)
- Creates a new instance of SimpleBufferPool
- Parameters:
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.
get
public java.nio.ByteBuffer get(int size)
- Specified by:
get
in interface BufferPool
put
public void put(java.nio.ByteBuffer buf)
- Specified by:
put
in interface BufferPool
putAll
public void putAll(java.util.List<java.nio.ByteBuffer> list)
- Specified by:
putAll
in interface BufferPool