public class ByteArrayTargetBuffer extends Object implements ReadTargetBuffer
Constructor and Description |
---|
ByteArrayTargetBuffer(byte[] target,
int offset)
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 ByteArrayTargetBuffer(byte[] target, int offset)
target
- offset
- 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 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 WritableByteChannel byteChannel()
byteChannel
in interface ReadTargetBuffer
Copyright © 2023. All Rights Reserved.