public class ByteBufferTargetBuffer extends Object implements ReadTargetBuffer
Constructor and Description |
---|
ByteBufferTargetBuffer(ByteBuffer target)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
byteArray() |
ByteBuffer |
byteBuffer() |
WritableByteChannel |
byteChannel() |
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 ByteBufferTargetBuffer(ByteBuffer target)
target
- public 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
Copyright © 2023. All Rights Reserved.