Top Description Fields Methods
io.netty.buffer

public Interface ByteBufAllocator

Known Direct Implementers
io.netty.buffer.AbstractByteBufAllocator

Implementations are responsible to allocate buffers. Implementations of this interface are expected to be thread-safe.

Field Summary

Modifier and TypeField and Description
public static final ByteBufAllocator

Method Summary

Modifier and TypeMethod and Description
public ByteBuf
buffer()

Allocate a ByteBuf.

public ByteBuf
buffer(int initialCapacity)

Allocate a ByteBuf with the given initial capacity.

public ByteBuf
buffer(int initialCapacity, int maxCapacity)

Allocate a ByteBuf with the given initial capacity and the given maximal capacity.

public int
calculateNewCapacity(int minNewCapacity, int maxCapacity)

Calculate the new capacity of a ByteBuf that is used when a ByteBuf needs to expand by the minNewCapacity with maxCapacity as upper-bound.

public CompositeByteBuf
public CompositeByteBuf
compositeBuffer(int maxNumComponents)

Allocate a CompositeByteBuf with the given maximum number of components that can be stored in it.

public CompositeByteBuf
public CompositeByteBuf
compositeDirectBuffer(int maxNumComponents)

Allocate a direct CompositeByteBuf with the given maximum number of components that can be stored in it.

public CompositeByteBuf
public CompositeByteBuf
compositeHeapBuffer(int maxNumComponents)

Allocate a heap CompositeByteBuf with the given maximum number of components that can be stored in it.

public ByteBuf
directBuffer()

Allocate a direct ByteBuf.

public ByteBuf
directBuffer(int initialCapacity)

Allocate a direct ByteBuf with the given initial capacity.

public ByteBuf
directBuffer(int initialCapacity, int maxCapacity)

Allocate a direct ByteBuf with the given initial capacity and the given maximal capacity.

public ByteBuf
heapBuffer()

Allocate a heap ByteBuf.

public ByteBuf
heapBuffer(int initialCapacity)

Allocate a heap ByteBuf with the given initial capacity.

public ByteBuf
heapBuffer(int initialCapacity, int maxCapacity)

Allocate a heap ByteBuf with the given initial capacity and the given maximal capacity.

public ByteBuf
ioBuffer()

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

public ByteBuf
ioBuffer(int initialCapacity)

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

public ByteBuf
ioBuffer(int initialCapacity, int maxCapacity)

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

public boolean
isDirectBufferPooled()

Returns true if direct ByteBuf's are pooled

Field Detail

DEFAULTback to summary
public static final ByteBufAllocator DEFAULT

Method Detail

bufferback to summary
public ByteBuf buffer()

Allocate a ByteBuf. If it is a direct or heap buffer depends on the actual implementation.

bufferback to summary
public ByteBuf buffer(int initialCapacity)

Allocate a ByteBuf with the given initial capacity. If it is a direct or heap buffer depends on the actual implementation.

bufferback to summary
public ByteBuf buffer(int initialCapacity, int maxCapacity)

Allocate a ByteBuf with the given initial capacity and the given maximal capacity. If it is a direct or heap buffer depends on the actual implementation.

calculateNewCapacityback to summary
public int calculateNewCapacity(int minNewCapacity, int maxCapacity)

Calculate the new capacity of a ByteBuf that is used when a ByteBuf needs to expand by the minNewCapacity with maxCapacity as upper-bound.

compositeBufferback to summary
public CompositeByteBuf compositeBuffer()

Allocate a CompositeByteBuf. If it is a direct or heap buffer depends on the actual implementation.

compositeBufferback to summary
public CompositeByteBuf compositeBuffer(int maxNumComponents)

Allocate a CompositeByteBuf 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.

compositeDirectBufferback to summary
public CompositeByteBuf compositeDirectBuffer()

Allocate a direct CompositeByteBuf.

compositeDirectBufferback to summary
public CompositeByteBuf compositeDirectBuffer(int maxNumComponents)

Allocate a direct CompositeByteBuf with the given maximum number of components that can be stored in it.

compositeHeapBufferback to summary
public CompositeByteBuf compositeHeapBuffer()

Allocate a heap CompositeByteBuf.

compositeHeapBufferback to summary
public CompositeByteBuf compositeHeapBuffer(int maxNumComponents)

Allocate a heap CompositeByteBuf with the given maximum number of components that can be stored in it.

directBufferback to summary
public ByteBuf directBuffer()

Allocate a direct ByteBuf.

directBufferback to summary
public ByteBuf directBuffer(int initialCapacity)

Allocate a direct ByteBuf with the given initial capacity.

directBufferback to summary
public ByteBuf directBuffer(int initialCapacity, int maxCapacity)

Allocate a direct ByteBuf with the given initial capacity and the given maximal capacity.

heapBufferback to summary
public ByteBuf heapBuffer()

Allocate a heap ByteBuf.

heapBufferback to summary
public ByteBuf heapBuffer(int initialCapacity)

Allocate a heap ByteBuf with the given initial capacity.

heapBufferback to summary
public ByteBuf heapBuffer(int initialCapacity, int maxCapacity)

Allocate a heap ByteBuf with the given initial capacity and the given maximal capacity.

ioBufferback to summary
public ByteBuf ioBuffer()

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

ioBufferback to summary
public ByteBuf ioBuffer(int initialCapacity)

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

ioBufferback to summary
public ByteBuf ioBuffer(int initialCapacity, int maxCapacity)

Allocate a ByteBuf, preferably a direct buffer which is suitable for I/O.

isDirectBufferPooledback to summary
public boolean isDirectBufferPooled()

Returns true if direct ByteBuf's are pooled