Interface IoAbsoluteReader
- All Known Subinterfaces:
ByteArray
- All Known Implementing Classes:
AbstractByteArray, BufferByteArray, ByteArrayPool.DirectBufferByteArray, CompositeByteArray
public interface IoAbsoluteReader
Provides absolute read access to a sequence of bytes.
-
Method Summary
Modifier and TypeMethodDescriptionintfirst()byteget(int index) voidGets enough bytes to fill theIoBufferfrom the given index.chargetChar(int index) doublegetDouble(int index) floatgetFloat(int index) intgetInt(int index) longgetLong(int index) shortgetShort(int index) intlast()intlength()order()slice(int index, int length) Creates an array with a view of part of this array.
-
Method Details
-
first
int first()- Returns:
- the index of the first byte that can be accessed.
-
last
int last()- Returns:
- the index after the last byte that can be accessed.
-
length
int length()- Returns:
- the total number of bytes that can be accessed.
-
slice
Creates an array with a view of part of this array.- Parameters:
index- The starting positionlength- The number of bytes to copy- Returns:
- The ByteArray that is a view on the original array
-
order
ByteOrder order()- Returns:
- the order of the bytes.
-
get
byte get(int index) - Parameters:
index- The starting position- Returns:
- a
bytefrom the given index.
-
get
Gets enough bytes to fill theIoBufferfrom the given index.- Parameters:
index- The starting positionbb- The IoBuffer that will be filled with the bytes
-
getShort
short getShort(int index) - Parameters:
index- The starting position- Returns:
- a
shortfrom the given index.
-
getInt
int getInt(int index) - Parameters:
index- The starting position- Returns:
- an
intfrom the given index.
-
getLong
long getLong(int index) - Parameters:
index- The starting position- Returns:
- a
longfrom the given index.
-
getFloat
float getFloat(int index) - Parameters:
index- The starting position- Returns:
- a
floatfrom the given index.
-
getDouble
double getDouble(int index) - Parameters:
index- The starting position- Returns:
- a
doublefrom the given index.
-
getChar
char getChar(int index) - Parameters:
index- The starting position- Returns:
- a
charfrom the given index.
-