Package io.netty.channel.unix
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
FieldsFields inherited from interface io.netty.buffer.ByteBufAllocator
DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuffer()
Allocate aByteBuf
.buffer
(int initialCapacity) Allocate aByteBuf
with the given initial capacity.buffer
(int initialCapacity, int maxCapacity) Allocate aByteBuf
with the given initial capacity and the given maximal capacity.int
calculateNewCapacity
(int minNewCapacity, int maxCapacity) Allocate aCompositeByteBuf
.compositeBuffer
(int maxNumComponents) Allocate aCompositeByteBuf
with the given maximum number of components that can be stored in it.Allocate a directCompositeByteBuf
.compositeDirectBuffer
(int maxNumComponents) Allocate a directCompositeByteBuf
with the given maximum number of components that can be stored in it.Allocate a heapCompositeByteBuf
.compositeHeapBuffer
(int maxNumComponents) Allocate a heapCompositeByteBuf
with the given maximum number of components that can be stored in it.Allocate a directByteBuf
.directBuffer
(int initialCapacity) Allocate a directByteBuf
with the given initial capacity.directBuffer
(int initialCapacity, int maxCapacity) Allocate a directByteBuf
with the given initial capacity and the given maximal capacity.Allocate a heapByteBuf
.heapBuffer
(int initialCapacity) Allocate a heapByteBuf
with the given initial capacity.heapBuffer
(int initialCapacity, int maxCapacity) Allocate a heapByteBuf
with 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.boolean
Returnstrue
if directByteBuf
's are pooledvoid
updateAllocator
(ByteBufAllocator allocator)
-
Field Details
-
allocator
-
-
Constructor Details
-
PreferredDirectByteBufAllocator
public PreferredDirectByteBufAllocator()
-
-
Method Details
-
updateAllocator
-
buffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
buffer
in interfaceByteBufAllocator
-
buffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
with the given initial capacity. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
buffer
in interfaceByteBufAllocator
-
buffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
with the given initial capacity and the given maximal capacity. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
buffer
in interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
ioBuffer
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
with the given initial capacity.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
heapBuffer
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
with the given initial capacity and the given maximal capacity.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
with the given initial capacity.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
directBuffer
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
with the given initial capacity and the given maximal capacity.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
compositeBuffer
Description copied from interface:ByteBufAllocator
Allocate aCompositeByteBuf
. If it is a direct or heap buffer depends on the actual implementation.- Specified by:
compositeBuffer
in interfaceByteBufAllocator
-
compositeBuffer
Description copied from interface:ByteBufAllocator
Allocate aCompositeByteBuf
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.- Specified by:
compositeBuffer
in interfaceByteBufAllocator
-
compositeHeapBuffer
Description copied from interface:ByteBufAllocator
Allocate a heapCompositeByteBuf
.- Specified by:
compositeHeapBuffer
in interfaceByteBufAllocator
-
compositeHeapBuffer
Description copied from interface:ByteBufAllocator
Allocate a heapCompositeByteBuf
with the given maximum number of components that can be stored in it.- Specified by:
compositeHeapBuffer
in interfaceByteBufAllocator
-
compositeDirectBuffer
Description copied from interface:ByteBufAllocator
Allocate a directCompositeByteBuf
.- Specified by:
compositeDirectBuffer
in interfaceByteBufAllocator
-
compositeDirectBuffer
Description copied from interface:ByteBufAllocator
Allocate a directCompositeByteBuf
with the given maximum number of components that can be stored in it.- Specified by:
compositeDirectBuffer
in interfaceByteBufAllocator
-
isDirectBufferPooled
public boolean isDirectBufferPooled()Description copied from interface:ByteBufAllocator
Returnstrue
if directByteBuf
's are pooled- Specified by:
isDirectBufferPooled
in interfaceByteBufAllocator
-
calculateNewCapacity
public int calculateNewCapacity(int minNewCapacity, int maxCapacity) Description copied from interface:ByteBufAllocator
Calculate the new capacity of aByteBuf
that is used when aByteBuf
needs to expand by theminNewCapacity
withmaxCapacity
as upper-bound.- Specified by:
calculateNewCapacity
in interfaceByteBufAllocator
-