public interface DataBuffer
Modifier and Type | Method and Description |
---|---|
long |
getLength()
Returns the length of the data.
|
Object |
getNettyOutput()
Returns an object for writing to a netty channel.
|
ByteBuffer |
getReadOnlyByteBuffer()
Returns a
ByteBuffer for read-only access to the data. |
int |
readableBytes() |
void |
readBytes(byte[] dst,
int dstIndex,
int length)
Transfers this buffer's data to the specified destination starting at
the current
readerIndex and increases the readerIndex
by the number of the transferred bytes (= length ). |
void |
readBytes(ByteBuffer outputBuf)
Transfers this buffer's data to the given
ByteBuffer . |
void |
readBytes(OutputStream outputStream,
int length)
Transfers this buffer's data to the given stream.
|
void |
release()
Releases the underlying buffer of this DataBuffer if no longer needed.
|
Object getNettyOutput()
long getLength()
ByteBuffer getReadOnlyByteBuffer()
ByteBuffer
for read-only access to the data.void readBytes(byte[] dst, int dstIndex, int length)
readerIndex
and increases the readerIndex
by the number of the transferred bytes (= length
).dst
- the destinationdstIndex
- the first index of the destinationlength
- the number of bytes to transfervoid readBytes(OutputStream outputStream, int length) throws IOException
outputStream
- the stream to transfer data tolength
- length of the data to be transferredIOException
void readBytes(ByteBuffer outputBuf)
ByteBuffer
.outputBuf
- the buffer to transfer data toint readableBytes()
void release()
Copyright © 2023. All Rights Reserved.