public static final class ByteBuffersDataOutput.ByteBufferRecycler
extends java.lang.Object
ByteBuffer allocation and recycling policy.
The blocks are recycled if exactly the same size is requested, otherwise
they're released to be GCed.| Modifier and Type | Field and Description |
|---|---|
private java.util.function.IntFunction<java.nio.ByteBuffer> |
delegate |
private java.util.ArrayDeque<java.nio.ByteBuffer> |
reuse |
| Constructor and Description |
|---|
ByteBufferRecycler(java.util.function.IntFunction<java.nio.ByteBuffer> delegate) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
allocate(int size) |
void |
reuse(java.nio.ByteBuffer buffer) |