public class NettyBufTargetBuffer extends Object implements ReadTargetBuffer
Constructor and Description |
---|
NettyBufTargetBuffer(io.netty.buffer.ByteBuf target) |
Modifier and Type | Method and Description |
---|---|
byte[] |
byteArray() |
ByteBuffer |
byteBuffer() |
WritableByteChannel |
byteChannel() |
io.netty.buffer.ByteBuf |
getTargetBuffer()
Get the internal Bytebuf object.
|
int |
offset() |
void |
offset(int newOffset)
Sets the new offset in the buffer.
|
int |
readFromFile(RandomAccessFile file,
int length) |
int |
readFromInputStream(InputStream is,
int length) |
long |
remaining() |
void |
writeBytes(byte[] srcArray,
int srcOffset,
int length) |
void |
writeBytes(io.netty.buffer.ByteBuf buf) |
public NettyBufTargetBuffer(io.netty.buffer.ByteBuf target)
target
- target bufferpublic byte[] byteArray()
byteArray
in interface ReadTargetBuffer
public ByteBuffer byteBuffer()
byteBuffer
in interface ReadTargetBuffer
public int offset()
offset
in interface ReadTargetBuffer
public void offset(int newOffset)
ReadTargetBuffer
offset
in interface ReadTargetBuffer
newOffset
- the new offsetpublic WritableByteChannel byteChannel()
byteChannel
in interface ReadTargetBuffer
public long remaining()
remaining
in interface ReadTargetBuffer
public void writeBytes(byte[] srcArray, int srcOffset, int length)
writeBytes
in interface ReadTargetBuffer
public void writeBytes(io.netty.buffer.ByteBuf buf)
writeBytes
in interface ReadTargetBuffer
public int readFromFile(RandomAccessFile file, int length) throws IOException
readFromFile
in interface ReadTargetBuffer
IOException
public int readFromInputStream(InputStream is, int length) throws IOException
readFromInputStream
in interface ReadTargetBuffer
IOException
public io.netty.buffer.ByteBuf getTargetBuffer()
Copyright © 2023. All Rights Reserved.