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 java.lang.Object implements ByteBufAllocator
-
-
Field Summary
-
Fields inherited from interface io.netty.buffer.ByteBufAllocator
DEFAULT
-
-
Constructor Summary
Constructors Constructor Description PreferredDirectByteBufAllocator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuf
buffer()
Allocate aByteBuf
.ByteBuf
buffer(int initialCapacity)
Allocate aByteBuf
with the given initial capacity.ByteBuf
buffer(int initialCapacity, int maxCapacity)
Allocate aByteBuf
with the given initial capacity and the given maximal capacity.int
calculateNewCapacity(int minNewCapacity, int maxCapacity)
CompositeByteBuf
compositeBuffer()
Allocate aCompositeByteBuf
.CompositeByteBuf
compositeBuffer(int maxNumComponents)
Allocate aCompositeByteBuf
with the given maximum number of components that can be stored in it.CompositeByteBuf
compositeDirectBuffer()
Allocate a directCompositeByteBuf
.CompositeByteBuf
compositeDirectBuffer(int maxNumComponents)
Allocate a directCompositeByteBuf
with the given maximum number of components that can be stored in it.CompositeByteBuf
compositeHeapBuffer()
Allocate a heapCompositeByteBuf
.CompositeByteBuf
compositeHeapBuffer(int maxNumComponents)
Allocate a heapCompositeByteBuf
with the given maximum number of components that can be stored in it.ByteBuf
directBuffer()
Allocate a directByteBuf
.ByteBuf
directBuffer(int initialCapacity)
Allocate a directByteBuf
with the given initial capacity.ByteBuf
directBuffer(int initialCapacity, int maxCapacity)
Allocate a directByteBuf
with the given initial capacity and the given maximal capacity.ByteBuf
heapBuffer()
Allocate a heapByteBuf
.ByteBuf
heapBuffer(int initialCapacity)
Allocate a heapByteBuf
with the given initial capacity.ByteBuf
heapBuffer(int initialCapacity, int maxCapacity)
Allocate a heapByteBuf
with the given initial capacity and the given maximal capacity.ByteBuf
ioBuffer()
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.ByteBuf
ioBuffer(int initialCapacity)
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.ByteBuf
ioBuffer(int initialCapacity, int maxCapacity)
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.boolean
isDirectBufferPooled()
Returnstrue
if directByteBuf
's are pooledvoid
updateAllocator(ByteBufAllocator allocator)
-
-
-
Method Detail
-
updateAllocator
public void updateAllocator(ByteBufAllocator allocator)
-
buffer
public ByteBuf 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
public ByteBuf buffer(int initialCapacity)
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
public ByteBuf buffer(int initialCapacity, int maxCapacity)
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
public ByteBuf ioBuffer()
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
ioBuffer
public ByteBuf ioBuffer(int initialCapacity)
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
ioBuffer
public ByteBuf ioBuffer(int initialCapacity, int maxCapacity)
Description copied from interface:ByteBufAllocator
Allocate aByteBuf
, preferably a direct buffer which is suitable for I/O.- Specified by:
ioBuffer
in interfaceByteBufAllocator
-
heapBuffer
public ByteBuf heapBuffer()
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
heapBuffer
public ByteBuf heapBuffer(int initialCapacity)
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
with the given initial capacity.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
heapBuffer
public ByteBuf heapBuffer(int initialCapacity, int maxCapacity)
Description copied from interface:ByteBufAllocator
Allocate a heapByteBuf
with the given initial capacity and the given maximal capacity.- Specified by:
heapBuffer
in interfaceByteBufAllocator
-
directBuffer
public ByteBuf directBuffer()
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
directBuffer
public ByteBuf directBuffer(int initialCapacity)
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
with the given initial capacity.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
directBuffer
public ByteBuf directBuffer(int initialCapacity, int maxCapacity)
Description copied from interface:ByteBufAllocator
Allocate a directByteBuf
with the given initial capacity and the given maximal capacity.- Specified by:
directBuffer
in interfaceByteBufAllocator
-
compositeBuffer
public CompositeByteBuf 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
public CompositeByteBuf compositeBuffer(int maxNumComponents)
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
public CompositeByteBuf compositeHeapBuffer()
Description copied from interface:ByteBufAllocator
Allocate a heapCompositeByteBuf
.- Specified by:
compositeHeapBuffer
in interfaceByteBufAllocator
-
compositeHeapBuffer
public CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
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
public CompositeByteBuf compositeDirectBuffer()
Description copied from interface:ByteBufAllocator
Allocate a directCompositeByteBuf
.- Specified by:
compositeDirectBuffer
in interfaceByteBufAllocator
-
compositeDirectBuffer
public CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
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
-
-