| Constructor and Description |
|---|
BufferAllocator()
Create a
BufferAllocator of size=256, direct=false, and bufferSize=Buffer.SMALL_BUFFER_SIZE. |
BufferAllocator(int poolSize,
boolean direct,
int bufferSize)
Create a
BufferAllocator. |
| Modifier and Type | Method and Description |
|---|---|
Reference<reactor.io.buffer.Buffer> |
allocate()
Allocate an object from the internal pool.
|
java.util.List<Reference<reactor.io.buffer.Buffer>> |
allocateBatch(int size)
Allocate a batch of objects all at once.
|
void |
release(java.util.List<Reference<reactor.io.buffer.Buffer>> batch)
Efficiently release a batch of References all at once.
|
public BufferAllocator()
BufferAllocator of size=256, direct=false, and bufferSize=Buffer.SMALL_BUFFER_SIZE.public BufferAllocator(int poolSize,
boolean direct,
int bufferSize)
BufferAllocator.poolSize - The number of Buffers to keep on hand.direct - Whether or not to use direct buffers.bufferSize - The size of the buffers.public Reference<reactor.io.buffer.Buffer> allocate()
Allocatorpublic java.util.List<Reference<reactor.io.buffer.Buffer>> allocateBatch(int size)
AllocatorallocateBatch in interface Allocator<reactor.io.buffer.Buffer>size - the number of objects to allocateList of References to the allocated objects