Package org.apache.mina.util.byteaccess
Interface IoAbsoluteReader
-
- All Known Subinterfaces:
ByteArray
- All Known Implementing Classes:
AbstractByteArray,BufferByteArray,CompositeByteArray
public interface IoAbsoluteReaderProvides absolute read access to a sequence of bytes.- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intfirst()byteget(int index)voidget(int index, IoBuffer bb)Gets 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()ByteOrderorder()ByteArrayslice(int index, int length)Creates an array with a view of part of this array.
-
-
-
Method Detail
-
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
ByteArray slice(int index, int length)
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
void get(int index, IoBuffer bb)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.
-
-