- java.lang.Object
-
- io.netty5.buffer.api.adaptor.ByteBufAllocatorAdaptor
-
- All Implemented Interfaces:
io.netty.buffer.ByteBufAllocator
,AutoCloseable
public class ByteBufAllocatorAdaptor extends Object implements io.netty.buffer.ByteBufAllocator, AutoCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static ByteBufAllocatorAdaptor
DEFAULT_INSTANCE
-
Constructor Summary
Constructors Constructor Description ByteBufAllocatorAdaptor(BufferAllocator onHeap, BufferAllocator offHeap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.netty.buffer.ByteBuf
buffer()
io.netty.buffer.ByteBuf
buffer(int initialCapacity)
io.netty.buffer.ByteBuf
buffer(int initialCapacity, int maxCapacity)
int
calculateNewCapacity(int minNewCapacity, int maxCapacity)
void
close()
io.netty.buffer.CompositeByteBuf
compositeBuffer()
io.netty.buffer.CompositeByteBuf
compositeBuffer(int maxNumComponents)
io.netty.buffer.CompositeByteBuf
compositeDirectBuffer()
io.netty.buffer.CompositeByteBuf
compositeDirectBuffer(int maxNumComponents)
io.netty.buffer.CompositeByteBuf
compositeHeapBuffer()
io.netty.buffer.CompositeByteBuf
compositeHeapBuffer(int maxNumComponents)
io.netty.buffer.ByteBuf
directBuffer()
io.netty.buffer.ByteBuf
directBuffer(int initialCapacity)
io.netty.buffer.ByteBuf
directBuffer(int initialCapacity, int maxCapacity)
BufferAllocator
getOffHeap()
BufferAllocator
getOnHeap()
io.netty.buffer.ByteBuf
heapBuffer()
io.netty.buffer.ByteBuf
heapBuffer(int initialCapacity)
io.netty.buffer.ByteBuf
heapBuffer(int initialCapacity, int maxCapacity)
io.netty.buffer.ByteBuf
ioBuffer()
io.netty.buffer.ByteBuf
ioBuffer(int initialCapacity)
io.netty.buffer.ByteBuf
ioBuffer(int initialCapacity, int maxCapacity)
boolean
isClosed()
boolean
isDirectBufferPooled()
-
-
-
Field Detail
-
DEFAULT_INSTANCE
public static final ByteBufAllocatorAdaptor DEFAULT_INSTANCE
-
-
Constructor Detail
-
ByteBufAllocatorAdaptor
public ByteBufAllocatorAdaptor(BufferAllocator onHeap, BufferAllocator offHeap)
-
-
Method Detail
-
buffer
public io.netty.buffer.ByteBuf buffer()
- Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
-
getOnHeap
public BufferAllocator getOnHeap()
-
getOffHeap
public BufferAllocator getOffHeap()
-
isClosed
public boolean isClosed()
-
buffer
public io.netty.buffer.ByteBuf buffer(int initialCapacity)
- Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
-
buffer
public io.netty.buffer.ByteBuf buffer(int initialCapacity, int maxCapacity)
- Specified by:
buffer
in interfaceio.netty.buffer.ByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer()
- Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity)
- Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
ioBuffer
public io.netty.buffer.ByteBuf ioBuffer(int initialCapacity, int maxCapacity)
- Specified by:
ioBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
heapBuffer
public io.netty.buffer.ByteBuf heapBuffer()
- Specified by:
heapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
heapBuffer
public io.netty.buffer.ByteBuf heapBuffer(int initialCapacity)
- Specified by:
heapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
heapBuffer
public io.netty.buffer.ByteBuf heapBuffer(int initialCapacity, int maxCapacity)
- Specified by:
heapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer()
- Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer(int initialCapacity)
- Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
directBuffer
public io.netty.buffer.ByteBuf directBuffer(int initialCapacity, int maxCapacity)
- Specified by:
directBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeBuffer
public io.netty.buffer.CompositeByteBuf compositeBuffer()
- Specified by:
compositeBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeBuffer
public io.netty.buffer.CompositeByteBuf compositeBuffer(int maxNumComponents)
- Specified by:
compositeBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeHeapBuffer
public io.netty.buffer.CompositeByteBuf compositeHeapBuffer()
- Specified by:
compositeHeapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeHeapBuffer
public io.netty.buffer.CompositeByteBuf compositeHeapBuffer(int maxNumComponents)
- Specified by:
compositeHeapBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeDirectBuffer
public io.netty.buffer.CompositeByteBuf compositeDirectBuffer()
- Specified by:
compositeDirectBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
compositeDirectBuffer
public io.netty.buffer.CompositeByteBuf compositeDirectBuffer(int maxNumComponents)
- Specified by:
compositeDirectBuffer
in interfaceio.netty.buffer.ByteBufAllocator
-
isDirectBufferPooled
public boolean isDirectBufferPooled()
- Specified by:
isDirectBufferPooled
in interfaceio.netty.buffer.ByteBufAllocator
-
calculateNewCapacity
public int calculateNewCapacity(int minNewCapacity, int maxCapacity)
- Specified by:
calculateNewCapacity
in interfaceio.netty.buffer.ByteBufAllocator
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-