public class BufferPool extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_POOL_SIZE |
protected static BufferPool |
instance |
protected int |
maxSize |
protected ConcurrentLinkedQueue<XByteBuffer> |
queue |
protected AtomicInteger |
size |
protected static StringManager |
sm |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
XByteBuffer |
getBuffer(int minSize,
boolean discard) |
static BufferPool |
getBufferPool() |
int |
getMaxSize() |
void |
returnBuffer(XByteBuffer buffer) |
void |
setMaxSize(int bytes) |
public static final int DEFAULT_POOL_SIZE
protected static final StringManager sm
protected static volatile BufferPool instance
protected int maxSize
protected final AtomicInteger size
protected final ConcurrentLinkedQueue<XByteBuffer> queue
public static BufferPool getBufferPool()
public XByteBuffer getBuffer(int minSize, boolean discard)
public void returnBuffer(XByteBuffer buffer)
public void clear()
public void setMaxSize(int bytes)
public int getMaxSize()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.