public class SimpleCachedBufferPool
extends java.lang.Object
Constructor and Description |
---|
SimpleCachedBufferPool(int maxBufferPoolSize,
int bufferSize,
BufferType preferredReusableBufferType) |
Modifier and Type | Method and Description |
---|---|
boolean |
atLimit()
Checks if the number of used buffers has exceeded the maximum number of cached buffers.
|
java.nio.ByteBuffer |
createBuffer() |
void |
emptyBufferPool()
Empties the buffer pool.
|
java.nio.ByteBuffer |
getThreadLocalReusableBuffer(int size) |
void |
releaseBuffer(java.nio.ByteBuffer buffer) |
java.lang.String |
toString() |
public SimpleCachedBufferPool(int maxBufferPoolSize, int bufferSize, BufferType preferredReusableBufferType)
public java.nio.ByteBuffer createBuffer()
public java.nio.ByteBuffer getThreadLocalReusableBuffer(int size)
public void releaseBuffer(java.nio.ByteBuffer buffer)
public void emptyBufferPool()
public boolean atLimit()
true
if the number of used buffers has exceeded the maximum number of cached buffers,
false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009-2022 The Apache Software Foundation