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(java.lang.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. |
java.lang.Iterable<IoBuffer> |
getIoBuffers()
Get the sequence of
IoBuffer s 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.
|
java.nio.ByteOrder |
order()
Gets the order of the bytes.
|
void |
order(java.nio.ByteOrder order)
Set the byte order of the array.
|
int first()
IoAbsoluteReader
first
in interface IoAbsoluteReader
first
in interface IoAbsoluteWriter
int last()
IoAbsoluteReader
last
in interface IoAbsoluteReader
last
in interface IoAbsoluteWriter
java.nio.ByteOrder order()
IoAbsoluteReader
order
in interface IoAbsoluteReader
order
in interface IoAbsoluteWriter
void order(java.nio.ByteOrder order)
void free()
java.lang.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(java.lang.Object other)
equals
in class java.lang.Object
byte get(int index)
IoAbsoluteReader
byte
from the given index.get
in interface IoAbsoluteReader
void get(int index, IoBuffer bb)
IoAbsoluteReader
IoBuffer
from the given index.get
in interface IoAbsoluteReader
int getInt(int index)
IoAbsoluteReader
int
from the given index.getInt
in interface IoAbsoluteReader
ByteArray.Cursor cursor()
ByteArray.Cursor cursor(int index)
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.