DataBufferFactory interface based on a
Netty 4 ByteBufAllocator.
io.netty.buffer.PooledByteBufAllocator , io.netty.buffer.UnpooledByteBufAllocator
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBufAllocator |
| Access | Constructor and Description |
|---|---|
| public | NettyDataBufferFactory(ByteBufAllocator
the factory to use byteBufAllocator)Create a new |
| Modifier and Type | Method and Description |
|---|---|
| public NettyDataBuffer | allocateBuffer()
Implements org.
Deprecated
Allocate a data buffer of a default initial capacity. |
| public NettyDataBuffer | allocateBuffer(int
the initial capacity of the buffer to allocate initialCapacity)Implements org. Allocate a data buffer of the given initial capacity. |
| public ByteBufAllocator | |
| public boolean | isDirect()
Implements org. Indicates whether this factory allocates direct buffers (i.e. non-heap, native memory). |
| public DataBuffer | join(List<? extends DataBuffer>
the data buffers to be composed dataBuffers)Implements org. Return a new |
| public static ByteBuf | Returns: the nettyByteBufthe dataBuffer)DataBuffer to return a ByteBuf forReturn the given Netty |
| public String | |
| public NettyDataBuffer | wrap(ByteBuffer
the NIO byte buffer to wrap byteBuffer)Implements org. Wrap the given |
| public DataBuffer | wrap(byte[]
the byte array to wrap bytes)Implements org. Wrap the given |
| public NettyDataBuffer |
| byteBufAllocator | back to summary |
|---|---|
| private final ByteBufAllocator byteBufAllocator | |
| NettyDataBufferFactory | back to summary |
|---|---|
| public NettyDataBufferFactory(ByteBufAllocator byteBufAllocator) Create a new
| |
| allocateBuffer | back to summary |
|---|---|
| public NettyDataBuffer allocateBuffer() Implements org. Doc from org. Deprecated
Allocate a data buffer of a default initial capacity. Depending on the underlying implementation and its configuration, this will be heap-based or direct buffer.
| |
| allocateBuffer | back to summary |
|---|---|
| public NettyDataBuffer allocateBuffer(int initialCapacity) Implements org. Doc from org. Allocate a data buffer of the given initial capacity. Depending on the underlying implementation and its configuration, this will be heap-based or direct buffer.
| |
| getByteBufAllocator | back to summary |
|---|---|
| public ByteBufAllocator getByteBufAllocator() Return the | |
| isDirect | back to summary |
|---|---|
| public boolean isDirect() Implements org. Doc from org. Indicates whether this factory allocates direct buffers (i.e. non-heap, native memory).
| |
| join | back to summary |
|---|---|
| public DataBuffer join(List<? extends DataBuffer> dataBuffers) Implements org. Doc from org. Return a new Note that the given data buffers do not have to be released, as they are released as part of the returned composite. This implementation uses Netty's
| |
| toByteBuf | back to summary |
|---|---|
| public static ByteBuf toByteBuf(DataBuffer dataBuffer) Return the given Netty Returns the native buffer
if
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| wrap | back to summary |
|---|---|
| public NettyDataBuffer wrap(ByteBuffer byteBuffer) Implements org. Doc from org. Wrap the given
| |
| wrap | back to summary |
|---|---|
| public DataBuffer wrap(byte[] bytes) Implements org. Doc from org. Wrap the given
| |
| wrap | back to summary |
|---|---|
| public NettyDataBuffer wrap(ByteBuf byteBuf) Wrap the given Netty
| |