Class PreferredDirectByteBufAllocator
java.lang.Object
io.netty.channel.unix.PreferredDirectByteBufAllocator
- All Implemented Interfaces:
ByteBufAllocator
@UnstableApi
public final class PreferredDirectByteBufAllocator
extends Object
implements ByteBufAllocator
-
Field Summary
Fields inherited from interface ByteBufAllocator
DEFAULT -
Constructor Summary
Constructors -
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 pooledvoidupdateAllocator(ByteBufAllocator allocator)
-
Constructor Details
-
PreferredDirectByteBufAllocator
public PreferredDirectByteBufAllocator()
-
-
Method Details
-
updateAllocator
-
buffer
Description copied from interface:ByteBufAllocatorAllocate aByteBuf. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
bufferin interfaceByteBufAllocator
-
buffer
Description copied from interface:ByteBufAllocatorAllocate aByteBufwith the given initial capacity. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
bufferin interfaceByteBufAllocator
-
buffer
Description copied from interface:ByteBufAllocatorAllocate aByteBufwith the given initial capacity and the given maximal capacity. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
bufferin interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocatorAllocate aByteBuf, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBufferin interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocatorAllocate aByteBuf, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBufferin interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocatorAllocate aByteBuf, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBufferin interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocatorAllocate a heapByteBuf.- Specified by:
heapBufferin interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocatorAllocate a heapByteBufwith the given initial capacity.- Specified by:
heapBufferin interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocatorAllocate a heapByteBufwith the given initial capacity and the given maximal capacity.- Specified by:
heapBufferin interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocatorAllocate a directByteBuf.- Specified by:
directBufferin interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocatorAllocate a directByteBufwith the given initial capacity.- Specified by:
directBufferin interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocatorAllocate a directByteBufwith the given initial capacity and the given maximal capacity.- Specified by:
directBufferin interfaceByteBufAllocator
-
compositeBuffer
Description copied from interface:ByteBufAllocatorAllocate aCompositeByteBuf. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
compositeBufferin interfaceByteBufAllocator
-
compositeBuffer
Description copied from interface:ByteBufAllocatorAllocate 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.- Specified by:
compositeBufferin interfaceByteBufAllocator
-
compositeHeapBuffer
Description copied from interface:ByteBufAllocatorAllocate a heapCompositeByteBuf.- Specified by:
compositeHeapBufferin interfaceByteBufAllocator
-
compositeHeapBuffer
Description copied from interface:ByteBufAllocatorAllocate a heapCompositeByteBufwith the given maximum number of components that can be stored in it.- Specified by:
compositeHeapBufferin interfaceByteBufAllocator
-
compositeDirectBuffer
Description copied from interface:ByteBufAllocatorAllocate a directCompositeByteBuf.- Specified by:
compositeDirectBufferin interfaceByteBufAllocator
-
compositeDirectBuffer
Description copied from interface:ByteBufAllocatorAllocate a directCompositeByteBufwith the given maximum number of components that can be stored in it.- Specified by:
compositeDirectBufferin interfaceByteBufAllocator
-
isDirectBufferPooled
public boolean isDirectBufferPooled()Description copied from interface:ByteBufAllocatorReturnstrueif directByteBuf's are pooled- Specified by:
isDirectBufferPooledin interfaceByteBufAllocator
-
calculateNewCapacity
public int calculateNewCapacity(int minNewCapacity, int maxCapacity) Description copied from interface:ByteBufAllocatorCalculate the new capacity of aByteBufthat is used when aByteBufneeds to expand by theminNewCapacitywithmaxCapacityas upper-bound.- Specified by:
calculateNewCapacityin interfaceByteBufAllocator
-