Interface ByteBufAllocator
- All Known Implementing Classes:
AbstractByteBufAllocator, AdaptiveByteBufAllocator, PooledByteBufAllocator, PreferHeapByteBufAllocator, PreferredDirectByteBufAllocator, UnpooledByteBufAllocator
public interface ByteBufAllocator
Implementations are responsible to allocate buffers. Implementations of this interface are expected to be
thread-safe.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuffer()Allocate aByteBuf.buffer(int initialCapacity) Allocate aByteBufwith the given initial capacity.buffer(int initialCapacity, int maxCapacity) Allocate aByteBufwith the given initial capacity and the given maximal capacity.intcalculateNewCapacity(int minNewCapacity, int maxCapacity) Allocate aCompositeByteBuf.compositeBuffer(int maxNumComponents) Allocate aCompositeByteBufwith the given maximum number of components that can be stored in it.Allocate a directCompositeByteBuf.compositeDirectBuffer(int maxNumComponents) Allocate a directCompositeByteBufwith the given maximum number of components that can be stored in it.Allocate a heapCompositeByteBuf.compositeHeapBuffer(int maxNumComponents) Allocate a heapCompositeByteBufwith the given maximum number of components that can be stored in it.Allocate a directByteBuf.directBuffer(int initialCapacity) Allocate a directByteBufwith the given initial capacity.directBuffer(int initialCapacity, int maxCapacity) Allocate a directByteBufwith the given initial capacity and the given maximal capacity.Allocate a heapByteBuf.heapBuffer(int initialCapacity) Allocate a heapByteBufwith the given initial capacity.heapBuffer(int initialCapacity, int maxCapacity) Allocate a heapByteBufwith the given initial capacity and the given maximal capacity.ioBuffer()Allocate aByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer(int initialCapacity) Allocate aByteBuf, preferably a direct buffer which is suitable for I/O.ioBuffer(int initialCapacity, int maxCapacity) Allocate aByteBuf, preferably a direct buffer which is suitable for I/O.booleanReturnstrueif directByteBuf's are pooled
-
Field Details
-
DEFAULT
-
-
Method Details
-
buffer
-
buffer
-
buffer
-
ioBuffer
-
ioBuffer
-
ioBuffer
-
heapBuffer
-
heapBuffer
-
heapBuffer
-
directBuffer
-
directBuffer
-
directBuffer
-
compositeBuffer
CompositeByteBuf compositeBuffer()Allocate aCompositeByteBuf. If it is a direct or heap buffer depends on the actual implementation. -
compositeBuffer
Allocate aCompositeByteBufwith 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. -
compositeHeapBuffer
CompositeByteBuf compositeHeapBuffer()Allocate a heapCompositeByteBuf. -
compositeHeapBuffer
Allocate a heapCompositeByteBufwith the given maximum number of components that can be stored in it. -
compositeDirectBuffer
CompositeByteBuf compositeDirectBuffer()Allocate a directCompositeByteBuf. -
compositeDirectBuffer
Allocate a directCompositeByteBufwith the given maximum number of components that can be stored in it. -
isDirectBufferPooled
boolean isDirectBufferPooled()Returnstrueif directByteBuf's are pooled -
calculateNewCapacity
-