public abstract class AbstractByteBufAllocator extends java.lang.Object implements ByteBufAllocator
ByteBufAllocator implementation to extend.DEFAULT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractByteBufAllocator()
Instance use heap buffers by default
|
protected |
AbstractByteBufAllocator(boolean preferDirect)
Create new instance
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
buffer()
Allocate a
ByteBuf. |
ByteBuf |
buffer(int initialCapacity)
Allocate a
ByteBuf with the given initial capacity. |
ByteBuf |
buffer(int initialCapacity,
int maxCapacity)
Allocate a
ByteBuf with the given initial capacity and the given
maximal capacity. |
CompositeByteBuf |
compositeBuffer()
Allocate a
CompositeByteBuf. |
CompositeByteBuf |
compositeBuffer(int maxNumComponents)
Allocate a
CompositeByteBuf with the given maximum number of components that can be stored in it. |
CompositeByteBuf |
compositeDirectBuffer()
Allocate a direct
CompositeByteBuf. |
CompositeByteBuf |
compositeDirectBuffer(int maxNumComponents)
Allocate a direct
CompositeByteBuf with the given maximum number of components that can be stored in it. |
CompositeByteBuf |
compositeHeapBuffer()
Allocate a heap
CompositeByteBuf. |
CompositeByteBuf |
compositeHeapBuffer(int maxNumComponents)
Allocate a heap
CompositeByteBuf with the given maximum number of components that can be stored in it. |
ByteBuf |
directBuffer()
Allocate a direct
ByteBuf. |
ByteBuf |
directBuffer(int initialCapacity)
Allocate a direct
ByteBuf with the given initial capacity. |
ByteBuf |
directBuffer(int initialCapacity,
int maxCapacity)
Allocate a direct
ByteBuf with the given initial capacity and the given
maximal capacity. |
ByteBuf |
heapBuffer()
Allocate a heap
ByteBuf. |
ByteBuf |
heapBuffer(int initialCapacity)
Allocate a heap
ByteBuf with the given initial capacity. |
ByteBuf |
heapBuffer(int initialCapacity,
int maxCapacity)
Allocate a heap
ByteBuf with the given initial capacity and the given
maximal capacity. |
ByteBuf |
ioBuffer()
Allocate a
ByteBuf, preferably a direct buffer which is suitable for I/O. |
ByteBuf |
ioBuffer(int initialCapacity)
Allocate a
ByteBuf, preferably a direct buffer which is suitable for I/O. |
ByteBuf |
ioBuffer(int initialCapacity,
int maxCapacity)
Allocate a
ByteBuf, preferably a direct buffer which is suitable for I/O. |
protected abstract ByteBuf |
newDirectBuffer(int initialCapacity,
int maxCapacity)
Create a direct
ByteBuf with the given initialCapacity and maxCapacity. |
protected abstract ByteBuf |
newHeapBuffer(int initialCapacity,
int maxCapacity)
Create a heap
ByteBuf with the given initialCapacity and maxCapacity. |
protected static ByteBuf |
toLeakAwareBuffer(ByteBuf buf) |
protected static CompositeByteBuf |
toLeakAwareBuffer(CompositeByteBuf buf) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisDirectBufferPooledprotected AbstractByteBufAllocator()
protected AbstractByteBufAllocator(boolean preferDirect)
preferDirect - true if buffer(int) should try to allocate a direct buffer rather than
a heap bufferprotected static CompositeByteBuf toLeakAwareBuffer(CompositeByteBuf buf)
public ByteBuf buffer()
ByteBufAllocatorByteBuf. If it is a direct or heap buffer
depends on the actual implementation.buffer in interface ByteBufAllocatorpublic ByteBuf buffer(int initialCapacity)
ByteBufAllocatorByteBuf with the given initial capacity.
If it is a direct or heap buffer depends on the actual implementation.buffer in interface ByteBufAllocatorpublic ByteBuf buffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf with the given initial capacity and the given
maximal capacity. If it is a direct or heap buffer depends on the actual
implementation.buffer in interface ByteBufAllocatorpublic ByteBuf ioBuffer()
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer in interface ByteBufAllocatorpublic ByteBuf ioBuffer(int initialCapacity)
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer in interface ByteBufAllocatorpublic ByteBuf ioBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer in interface ByteBufAllocatorpublic ByteBuf heapBuffer()
ByteBufAllocatorByteBuf.heapBuffer in interface ByteBufAllocatorpublic ByteBuf heapBuffer(int initialCapacity)
ByteBufAllocatorByteBuf with the given initial capacity.heapBuffer in interface ByteBufAllocatorpublic ByteBuf heapBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf with the given initial capacity and the given
maximal capacity.heapBuffer in interface ByteBufAllocatorpublic ByteBuf directBuffer()
ByteBufAllocatorByteBuf.directBuffer in interface ByteBufAllocatorpublic ByteBuf directBuffer(int initialCapacity)
ByteBufAllocatorByteBuf with the given initial capacity.directBuffer in interface ByteBufAllocatorpublic ByteBuf directBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf with the given initial capacity and the given
maximal capacity.directBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeBuffer()
ByteBufAllocatorCompositeByteBuf.
If it is a direct or heap buffer depends on the actual implementation.compositeBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.
If it is a direct or heap buffer depends on the actual implementation.compositeBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeHeapBuffer()
ByteBufAllocatorCompositeByteBuf.compositeHeapBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeHeapBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeDirectBuffer()
ByteBufAllocatorCompositeByteBuf.compositeDirectBuffer in interface ByteBufAllocatorpublic CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeDirectBuffer in interface ByteBufAllocatorprotected abstract ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity)
ByteBuf with the given initialCapacity and maxCapacity.protected abstract ByteBuf newDirectBuffer(int initialCapacity, int maxCapacity)
ByteBuf with the given initialCapacity and maxCapacity.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2018 The Netty Project. All rights reserved.