public interface ByteBufAllocator
Implementations are responsible to allocate buffers.
Interface design reference netty io.netty.buffer.ByteBufAllocator, The ByteBuf implementation is replaced with cobble.bytebuf
| 限定符和类型 | 字段和说明 |
|---|---|
static ByteBufAllocator |
DEFAULT |
| 限定符和类型 | 方法和说明 |
|---|---|
ByteBuf |
arrayBuffer()
Allocate a
ByteBuf, with the bytes array. |
ByteBuf |
arrayBuffer(int capacity)
Allocate a
ByteBuf, with the bytes array. |
ByteBuf |
arrayBuffer(int initialCapacity,
int maxCapacity)
Allocate a
ByteBuf, with the bytes array. |
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. |
ByteBuf |
directBuffer()
Allocate a direct
ByteBuf. |
ByteBuf |
directBuffer(int capacity)
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 capacity)
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. |
boolean |
isDirect()
Returns
true if pooled ByteBuf's |
boolean |
isPooled()
Returns
true if direct ByteBuf's |
ByteBuf |
pooledBuffer()
Allocate pooled
ByteBuf. |
ByteBuf |
pooledBuffer(int maxCapacity,
int sliceSize)
Allocate pooled
ByteBuf with the given maximal capacity. |
ByteBuf |
pooledBuffer(int initialCapacity,
int maxCapacity,
int sliceSize)
Allocate a direct
ByteBuf with the given initial capacity and the given maximal capacity. |
ByteBuf |
pooledDirectBuffer()
Allocate pooled
ByteBuf. |
ByteBuf |
pooledDirectBuffer(int maxCapacity,
int sliceSize)
Allocate pooled
ByteBuf with the given maximal capacity. |
ByteBuf |
pooledDirectBuffer(int initialCapacity,
int maxCapacity,
int sliceSize)
Allocate a direct
ByteBuf with the given initial capacity and the given maximal capacity. |
ByteBuf |
pooledHeapBuffer()
Allocate pooled
ByteBuf. |
ByteBuf |
pooledHeapBuffer(int maxCapacity,
int sliceSize)
Allocate pooled
ByteBuf with the given maximal capacity. |
ByteBuf |
pooledHeapBuffer(int initialCapacity,
int maxCapacity,
int sliceSize)
Allocate a direct
ByteBuf with the given initial capacity and the given maximal capacity. |
ByteBuf |
wrap(byte[] bytes)
Allocate a
ByteBuf, with the bytes array. |
ByteBuf |
wrap(ByteBuffer javaBuffer)
Allocate a
ByteBuf, with the ByteBuffer. |
static final ByteBufAllocator DEFAULT
ByteBuf buffer()
ByteBuf.
If it is a direct or heap buffer depends on the actual implementation.ByteBuf buffer(int initialCapacity)
ByteBuf with the given initial capacity.
If it is a direct or heap buffer depends on the actual implementation.ByteBuf buffer(int initialCapacity, int maxCapacity)
ByteBuf with the given initial capacity and the given maximal capacity.
If it is a direct or heap buffer depends on the actual implementation.boolean isPooled()
true if direct ByteBuf'sboolean isDirect()
true if pooled ByteBuf'sByteBuf wrap(ByteBuffer javaBuffer)
ByteBuf, with the ByteBuffer.ByteBuf arrayBuffer(int initialCapacity, int maxCapacity)
ByteBuf, with the bytes array.ByteBuf heapBuffer(int capacity)
ByteBuf with the given initial capacity.ByteBuf heapBuffer(int initialCapacity, int maxCapacity)
ByteBuf with the given initial capacity and the given maximal capacity.ByteBuf directBuffer(int capacity)
ByteBuf with the given initial capacity.ByteBuf directBuffer(int initialCapacity, int maxCapacity)
ByteBuf with the given initial capacity and the given maximal capacity.ByteBuf pooledBuffer()
ByteBuf.
If it is a direct or heap buffer depends on the actual implementation.ByteBuf pooledBuffer(int maxCapacity, int sliceSize)
ByteBuf with the given maximal capacity.
If it is a direct or heap buffer depends on the actual implementation.ByteBuf pooledBuffer(int initialCapacity, int maxCapacity, int sliceSize)
ByteBuf with the given initial capacity and the given maximal capacity.
If it is a direct or heap buffer depends on the actual implementation.ByteBuf pooledHeapBuffer(int maxCapacity, int sliceSize)
ByteBuf with the given maximal capacity.ByteBuf pooledHeapBuffer(int initialCapacity, int maxCapacity, int sliceSize)
ByteBuf with the given initial capacity and the given maximal capacity.ByteBuf pooledDirectBuffer(int maxCapacity, int sliceSize)
ByteBuf with the given maximal capacity.Copyright © 2022–2024. All rights reserved.