public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter
Modifier and Type | Interface and Description |
---|---|
static interface |
ByteArray.Cursor
Provides relocatable, relative access to the underlying array.
|
Modifier and Type | Method and Description |
---|---|
ByteArray.Cursor |
cursor() |
ByteArray.Cursor |
cursor(int index) |
boolean |
equals(Object other)
A ByteArray is equal to another ByteArray if they start and end at the
same index, have the same byte order, and contain the same bytes at each
index.
|
int |
first() |
void |
free()
Remove any resources associated with this object.
|
byte |
get(int index) |
void |
get(int index,
IoBuffer bb)
Gets enough bytes to fill the IoBuffer from the given index.
|
int |
getInt(int index) |
Iterable<IoBuffer> |
getIoBuffers() |
IoBuffer |
getSingleIoBuffer() |
int |
last() |
ByteOrder |
order() |
void |
order(ByteOrder order)
Set the byte order of the array.
|
int first()
first
in interface IoAbsoluteReader
first
in interface IoAbsoluteWriter
int last()
last
in interface IoAbsoluteReader
last
in interface IoAbsoluteWriter
ByteOrder order()
order
in interface IoAbsoluteReader
order
in interface IoAbsoluteWriter
void order(ByteOrder order)
order
- The ByteOrder to usevoid free()
Iterable<IoBuffer> getIoBuffers()
IoBuffer
s that back this array.
Compared to getSingleIoBuffer()
, this method should be
relatively efficient for all implementations.IoBuffer getSingleIoBuffer()
IoBuffer
that backs this array. Some
implementations may initially have data split across multiple buffers, so
calling this method may require a new buffer to be allocated and
populated.boolean equals(Object other)
byte get(int index)
get
in interface IoAbsoluteReader
index
- The starting positionvoid get(int index, IoBuffer bb)
get
in interface IoAbsoluteReader
index
- The starting positionbb
- The IoBuffer that will be filled with the bytesint getInt(int index)
getInt
in interface IoAbsoluteReader
index
- The starting positionByteArray.Cursor cursor()
ByteArray.Cursor cursor(int index)
index
- The starting pointCopyright © 2004–2021 Apache MINA Project. All rights reserved.