public class SimpleBufferPool extends Object implements ByteBufferPool
BufferPool which does no pooling and just
creates new buffers each time| Constructor and Description |
|---|
SimpleBufferPool() |
SimpleBufferPool(boolean useDirect) |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
borrowBuffer()
Extract a buffer from the pool.
|
protected ByteBuffer |
createBuffer() |
boolean |
isUseDirect() |
void |
returnBuffer(ByteBuffer buffer)
Returns the buffer to the pool or just discards it for a non-pool strategy
|
void |
setDefaultSize(int defaultSize)
Sets the default size of the buffers
|
void |
setUseDirect(boolean useDirect)
Sets whether direct buffers are used or not
|
void |
start() |
void |
stop() |
public SimpleBufferPool()
public SimpleBufferPool(boolean useDirect)
public ByteBuffer borrowBuffer()
ByteBufferPoolborrowBuffer in interface ByteBufferPoolpublic void returnBuffer(ByteBuffer buffer)
ByteBufferPoolreturnBuffer in interface ByteBufferPoolpublic void setDefaultSize(int defaultSize)
ByteBufferPoolsetDefaultSize in interface ByteBufferPoolpublic boolean isUseDirect()
public void setUseDirect(boolean useDirect)
protected ByteBuffer createBuffer()
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.