final class ByteBufferPool
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
ByteBufferPool.ByteBufferAllocatorImpl
The allocator implementation.
|
Modifier and Type | Field and Description |
---|---|
private int |
bufferSize
The size of each byte buffer.
|
private java.util.Queue<java.nio.ByteBuffer> |
byteBuffers
The shared collection of byte buffers.
|
Modifier | Constructor and Description |
---|---|
private |
ByteBufferPool(int bufferSize)
Creates a new pool.
|
Modifier and Type | Method and Description |
---|---|
(package private) ByteBufferAllocator |
newAllocator(int maxBufferCount)
Creates a new allocator associated with this pool.
|
(package private) static ByteBufferPool |
newInstance(int bufferSize)
Creates a new pool.
|
private final java.util.Queue<java.nio.ByteBuffer> byteBuffers
private final int bufferSize
static ByteBufferPool newInstance(int bufferSize)
ByteBufferAllocator newAllocator(int maxBufferCount)
maxBufferCount
buffers allocated through this allocator
at any given time moment.