public final class UnpooledByteBufAllocator extends AbstractByteBufAllocator
ByteBufAllocator
implementation that does not pool anything.Modifier and Type | Field and Description |
---|---|
static UnpooledByteBufAllocator |
DEFAULT
Default instance
|
Constructor and Description |
---|
UnpooledByteBufAllocator(boolean preferDirect)
Create a new instance
|
Modifier and Type | Method and Description |
---|---|
boolean |
isDirectBufferPooled()
Returns
true if direct ByteBuf 's are pooled |
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, compositeDirectBuffer, compositeHeapBuffer, compositeHeapBuffer, directBuffer, directBuffer, directBuffer, heapBuffer, heapBuffer, heapBuffer, ioBuffer, ioBuffer, ioBuffer, toLeakAwareBuffer, toString
public 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 bufferprotected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocator
ByteBuf
with the given initialCapacity and maxCapacity.newHeapBuffer
in class AbstractByteBufAllocator
protected ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
AbstractByteBufAllocator
ByteBuf
with the given initialCapacity and maxCapacity.newDirectBuffer
in class AbstractByteBufAllocator
public boolean isDirectBufferPooled()
ByteBufAllocator
true
if direct ByteBuf
's are pooledCopyright © 2008–2014 The Netty Project. All rights reserved.