public interface ByteArray extends IoAbsoluteReader, IoAbsoluteWriter
限定符和类型 | 接口和说明 |
---|---|
static interface |
ByteArray.Cursor
Provides relocatable, relative access to the underlying array.
|
限定符和类型 | 方法和说明 |
---|---|
ByteArray.Cursor |
cursor() |
ByteArray.Cursor |
cursor(int 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() |
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) |
java.lang.Iterable<IoBuffer> |
getIoBuffers() |
IoBuffer |
getSingleIoBuffer() |
int |
last() |
java.nio.ByteOrder |
order() |
void |
order(java.nio.ByteOrder order)
Set the byte order of the array.
|
int first()
first
在接口中 IoAbsoluteReader
first
在接口中 IoAbsoluteWriter
int last()
last
在接口中 IoAbsoluteReader
last
在接口中 IoAbsoluteWriter
java.nio.ByteOrder order()
order
在接口中 IoAbsoluteReader
order
在接口中 IoAbsoluteWriter
void order(java.nio.ByteOrder order)
order
- The ByteOrder to usevoid 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
在类中 java.lang.Object
other
- The ByteArray we want to compare withbyte get(int index)
get
在接口中 IoAbsoluteReader
index
- The starting positionvoid get(int index, IoBuffer bb)
get
在接口中 IoAbsoluteReader
index
- The starting positionbb
- The IoBuffer that will be filled with the bytesint getInt(int index)
getInt
在接口中 IoAbsoluteReader
index
- The starting positionByteArray.Cursor cursor()
ByteArray.Cursor cursor(int index)
index
- The starting point