public class SimpleBufferPool extends java.lang.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 |
|---|---|
java.nio.ByteBuffer |
borrowBuffer()
Extract a buffer from the pool.
|
protected java.nio.ByteBuffer |
createBuffer() |
boolean |
isUseDirect() |
void |
returnBuffer(java.nio.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 java.nio.ByteBuffer borrowBuffer()
ByteBufferPoolborrowBuffer in interface ByteBufferPoolpublic void returnBuffer(java.nio.ByteBuffer buffer)
ByteBufferPoolreturnBuffer in interface ByteBufferPoolpublic void setDefaultSize(int defaultSize)
ByteBufferPoolsetDefaultSize in interface ByteBufferPoolpublic boolean isUseDirect()
public void setUseDirect(boolean useDirect)
public void start()
throws java.lang.Exception
public void stop()
throws java.lang.Exception
protected java.nio.ByteBuffer createBuffer()
Copyright © 2005-2014 Red Hat, Inc.. All Rights Reserved.