@UnstableApi public final class PreferredDirectByteBufAllocator extends java.lang.Object implements ByteBufAllocator
DEFAULT| 构造器和说明 |
|---|
PreferredDirectByteBufAllocator() |
| 限定符和类型 | 方法和说明 |
|---|---|
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. |
int |
calculateNewCapacity(int minNewCapacity,
int maxCapacity)
|
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. |
boolean |
isDirectBufferPooled()
Returns
true if direct ByteBuf's are pooled |
void |
updateAllocator(ByteBufAllocator allocator) |
public void updateAllocator(ByteBufAllocator allocator)
public ByteBuf buffer()
ByteBufAllocatorByteBuf. If it is a direct or heap buffer
depends on the actual implementation.buffer 在接口中 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 在接口中 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 在接口中 ByteBufAllocatorpublic ByteBuf ioBuffer()
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer 在接口中 ByteBufAllocatorpublic ByteBuf ioBuffer(int initialCapacity)
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer 在接口中 ByteBufAllocatorpublic ByteBuf ioBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer 在接口中 ByteBufAllocatorpublic ByteBuf heapBuffer()
ByteBufAllocatorByteBuf.heapBuffer 在接口中 ByteBufAllocatorpublic ByteBuf heapBuffer(int initialCapacity)
ByteBufAllocatorByteBuf with the given initial capacity.heapBuffer 在接口中 ByteBufAllocatorpublic ByteBuf heapBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf with the given initial capacity and the given
maximal capacity.heapBuffer 在接口中 ByteBufAllocatorpublic ByteBuf directBuffer()
ByteBufAllocatorByteBuf.directBuffer 在接口中 ByteBufAllocatorpublic ByteBuf directBuffer(int initialCapacity)
ByteBufAllocatorByteBuf with the given initial capacity.directBuffer 在接口中 ByteBufAllocatorpublic ByteBuf directBuffer(int initialCapacity, int maxCapacity)
ByteBufAllocatorByteBuf with the given initial capacity and the given
maximal capacity.directBuffer 在接口中 ByteBufAllocatorpublic CompositeByteBuf compositeBuffer()
ByteBufAllocatorCompositeByteBuf.
If it is a direct or heap buffer depends on the actual implementation.compositeBuffer 在接口中 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 在接口中 ByteBufAllocatorpublic CompositeByteBuf compositeHeapBuffer()
ByteBufAllocatorCompositeByteBuf.compositeHeapBuffer 在接口中 ByteBufAllocatorpublic CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeHeapBuffer 在接口中 ByteBufAllocatorpublic CompositeByteBuf compositeDirectBuffer()
ByteBufAllocatorCompositeByteBuf.compositeDirectBuffer 在接口中 ByteBufAllocatorpublic CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
ByteBufAllocatorCompositeByteBuf with the given maximum number of components that can be stored in it.compositeDirectBuffer 在接口中 ByteBufAllocatorpublic boolean isDirectBufferPooled()
ByteBufAllocatortrue if direct ByteBuf's are pooledisDirectBufferPooled 在接口中 ByteBufAllocatorpublic int calculateNewCapacity(int minNewCapacity,
int maxCapacity)
ByteBufAllocatorByteBuf that is used when a ByteBuf needs to expand by the
minNewCapacity with maxCapacity as upper-bound.calculateNewCapacity 在接口中 ByteBufAllocator