public final class DataNettyBuffer extends Object implements DataBuffer
ByteBuf.| Constructor and Description |
|---|
DataNettyBuffer(io.netty.buffer.ByteBuf bytebuf,
long length)
Constructor for creating a DataNettyBuffer, by passing a Netty ByteBuf.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLength()
Returns the length of the data.
|
Object |
getNettyOutput()
We would not support this method in DataNettyBuffer because this class is only for
reading netty buffers.
|
ByteBuffer |
getReadOnlyByteBuffer()
Returns a
ByteBuffer for read-only access to the data. |
void |
release()
Release the Netty ByteBuf.
|
public DataNettyBuffer(io.netty.buffer.ByteBuf bytebuf,
long length)
release() must be called after
reading is finished. Otherwise the memory space for the ByteBuf might never be reclaimed.bytebuf - The ByteBuf having the datalength - The length of the underlying ByteBuffer datapublic Object getNettyOutput()
getNettyOutput in interface DataBufferUnsupportedOperationException - whenever calledpublic long getLength()
DataBuffergetLength in interface DataBufferpublic ByteBuffer getReadOnlyByteBuffer()
DataBufferByteBuffer for read-only access to the data.getReadOnlyByteBuffer in interface DataBufferpublic void release()
release in interface DataBufferCopyright © 2015. All Rights Reserved.