|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ByteArray
Represents a sequence of bytes that can be read or written directly or through a cursor.
| Nested Class Summary | |
|---|---|
static interface |
ByteArray.Cursor
Provides relocatable, relative access to the underlying array. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from interface org.apache.mina.util.byteaccess.IoAbsoluteReader |
|---|
getChar, getDouble, getFloat, getLong, getShort, length, slice |
| Methods inherited from interface org.apache.mina.util.byteaccess.IoAbsoluteWriter |
|---|
put, put, putChar, putDouble, putFloat, putInt, putLong, putShort |
| Method Detail |
|---|
int first()
IoAbsoluteReader
first in interface IoAbsoluteReaderfirst in interface IoAbsoluteWriterint last()
IoAbsoluteReader
last in interface IoAbsoluteReaderlast in interface IoAbsoluteWriterByteOrder order()
IoAbsoluteReader
order 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)
equals in class Objectbyte get(int index)
IoAbsoluteReaderbyte from the given index.
get in interface IoAbsoluteReader
void 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||