com.kenai.jaffl.util

Class SimpleBufferPool

public class SimpleBufferPool extends Object implements BufferPool

Constructor Summary
SimpleBufferPool(int bufferSize, int poolSize)
Creates a new instance of SimpleBufferPool
SimpleBufferPool(BufferPool parent, int bufferSize, int poolSize)
Creates a new instance of SimpleBufferPool
Method Summary
ByteBufferget(int size)
voidput(ByteBuffer buf)
voidputAll(List<ByteBuffer> list)

Constructor Detail

SimpleBufferPool

public SimpleBufferPool(int bufferSize, int poolSize)
Creates a new instance of SimpleBufferPool

Parameters: bufferSize The Size of ByteBuffer this pool should return poolSize 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.

Method Detail

get

public ByteBuffer get(int size)

put

public void put(ByteBuffer buf)

putAll

public void putAll(List<ByteBuffer> list)