public class ByteBufferPool
extends java.lang.Object
PoolableByteBuffer
s.Modifier and Type | Method and Description |
---|---|
static ByteBufferPool |
getInstance() |
T |
getOrCreate()
If the pool is not empty, removes an object from the pool and returns it;
otherwise, constructs a new object.
|
void |
returnToPool(T object)
Adds the provided instance to the pool.
|
public static ByteBufferPool getInstance()
ByteBufferPool
.public T getOrCreate()
public void returnToPool(T object)
object
- An object to add to the pool.