public final class UnpooledByteBufAllocator extends AbstractByteBufAllocator implements ByteBufAllocatorMetricProvider
ByteBufAllocator implementation that does not pool anything.| Modifier and Type | Field and Description |
|---|---|
static UnpooledByteBufAllocator |
DEFAULT
Default instance which uses leak-detection for direct buffers.
|
| Constructor and Description |
|---|
UnpooledByteBufAllocator(boolean preferDirect)
Create a new instance which uses leak-detection for direct buffers.
|
UnpooledByteBufAllocator(boolean preferDirect,
boolean disableLeakDetector)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
CompositeByteBuf |
compositeDirectBuffer(int maxNumComponents)
Allocate a direct
CompositeByteBuf with the given maximum number of components that can be stored in it. |
CompositeByteBuf |
compositeHeapBuffer(int maxNumComponents)
Allocate a heap
CompositeByteBuf with the given maximum number of components that can be stored in it. |
boolean |
isDirectBufferPooled()
Returns
true if direct ByteBuf's are pooled |
ByteBufAllocatorMetric |
metric()
Returns a
ByteBufAllocatorMetric for a ByteBufAllocator. |
protected ByteBuf |
newDirectBuffer(int initialCapacity,
int maxCapacity)
Create a direct
ByteBuf with the given initialCapacity and maxCapacity. |
protected ByteBuf |
newHeapBuffer(int initialCapacity,
int maxCapacity)
Create a heap
ByteBuf with the given initialCapacity and maxCapacity. |
buffer, buffer, buffer, calculateNewCapacity, compositeBuffer, compositeBuffer, compositeDirectBuffer, compositeHeapBuffer, directBuffer, directBuffer, directBuffer, heapBuffer, heapBuffer, heapBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toLeakAwareBuffer, toStringpublic static final UnpooledByteBufAllocator DEFAULT
public UnpooledByteBufAllocator(boolean preferDirect)
preferDirect - true if AbstractByteBufAllocator.buffer(int) should try to allocate a direct buffer rather than
a heap bufferpublic UnpooledByteBufAllocator(boolean preferDirect,
boolean disableLeakDetector)
preferDirect - true if AbstractByteBufAllocator.buffer(int) should try to allocate a direct buffer rather than
a heap bufferdisableLeakDetector - true if the leak-detection should be disabled completely for this
allocator. This can be useful if the user just want to depend on the GC to handle
direct buffers when not explicit released.protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocatorByteBuf with the given initialCapacity and maxCapacity.newHeapBuffer in class AbstractByteBufAllocatorprotected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocatorByteBuf with the given initialCapacity and maxCapacity.newDirectBuffer in class AbstractByteBufAllocatorpublic CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeHeapBuffer in interface ByteBufAllocatorcompositeHeapBuffer in class AbstractByteBufAllocatorpublic CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeDirectBuffer in interface ByteBufAllocatorcompositeDirectBuffer in class AbstractByteBufAllocatorpublic boolean isDirectBufferPooled()
ByteBufAllocatortrue if direct ByteBuf's are pooledisDirectBufferPooled in interface ByteBufAllocatorpublic ByteBufAllocatorMetric metric()
ByteBufAllocatorMetricProviderByteBufAllocatorMetric for a ByteBufAllocator.metric in interface ByteBufAllocatorMetricProviderCopyright © 2008–2017 The Netty Project. All rights reserved.