public class SimpleBufferPool extends Object implements ByteBufferPool
BufferPool
which does no pooling and just
creates new buffers each timeConstructor 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()
ByteBufferPool
borrowBuffer
in interface ByteBufferPool
public void returnBuffer(ByteBuffer buffer)
ByteBufferPool
returnBuffer
in interface ByteBufferPool
public void setDefaultSize(int defaultSize)
ByteBufferPool
setDefaultSize
in interface ByteBufferPool
public boolean isUseDirect()
public void setUseDirect(boolean useDirect)
protected ByteBuffer createBuffer()
Copyright © 2005–2016 FuseSource, Corp.. All rights reserved.