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()
Get a cursor starting at index 0 (which may not be the start of the array).
|
ByteArray.Cursor |
cursor(int index)
Get a cursor starting at the given 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()
Get the index of the first byte that can be accessed.
|
void |
free()
Remove any resources associated with this object.
|
byte |
get(int index)
Gets a
byte from the given index. |
void |
get(int index,
IoBuffer bb)
Gets enough bytes to fill the
IoBuffer from the given index. |
int |
getInt(int index)
Gets an
int from the given index. |
Iterable<IoBuffer> |
getIoBuffers()
Get the sequence of
IoBuffers that back this array. |
IoBuffer |
getSingleIoBuffer()
Gets a single
IoBuffer that backs this array. |
int |
last()
Gets the index after the last byte that can be accessed.
|
ByteOrder |
order()
Gets the order of the bytes.
|
void |
order(ByteOrder order)
Set the byte order of the array.
|
int first()
IoAbsoluteReaderfirst in interface IoAbsoluteReaderfirst in interface IoAbsoluteWriterint last()
IoAbsoluteReaderlast in interface IoAbsoluteReaderlast in interface IoAbsoluteWriterByteOrder order()
IoAbsoluteReaderorder in interface IoAbsoluteReaderorder in interface IoAbsoluteWritervoid order(ByteOrder order)
void free()
Iterable<IoBuffer> getIoBuffers()
IoBuffers 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)
IoAbsoluteReaderbyte from the given index.get in interface IoAbsoluteReadervoid get(int index,
IoBuffer bb)
IoAbsoluteReaderIoBuffer from the given index.get in interface IoAbsoluteReaderint getInt(int index)
IoAbsoluteReaderint from the given index.getInt in interface IoAbsoluteReaderByteArray.Cursor cursor()
ByteArray.Cursor cursor(int index)