Package org.apache.mina.util.byteaccess
Interface IoRelativeReader
-
- All Known Subinterfaces:
ByteArray.Cursor
- All Known Implementing Classes:
CompositeByteArrayRelativeReader
public interface IoRelativeReaderProvides relative read access to a sequence of bytes.- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byteget()voidget(IoBuffer bb)Gets enough bytes to fill theIoBufferand advances the reader.chargetChar()doublegetDouble()floatgetFloat()intgetInt()longgetLong()intgetRemaining()shortgetShort()booleanhasRemaining()Checks if there are any remaining bytes that can be read.ByteOrderorder()voidskip(int length)Advances the reader by the given number of bytes.ByteArrayslice(int length)
-
-
-
Method Detail
-
getRemaining
int getRemaining()
- Returns:
- the number of remaining bytes that can be read.
-
hasRemaining
boolean hasRemaining()
Checks if there are any remaining bytes that can be read.- Returns:
trueif there are some remaining bytes in the buffer
-
skip
void skip(int length)
Advances the reader by the given number of bytes.- Parameters:
length- the number of bytes to skip
-
slice
ByteArray slice(int length)
- Parameters:
length- The number of bytes to get- Returns:
- an array with a view of part of this array.
-
order
ByteOrder order()
- Returns:
- the bytes' order
-
get
byte get()
- Returns:
- the
byteat the current position and advances the reader.
-
get
void get(IoBuffer bb)
Gets enough bytes to fill theIoBufferand advances the reader.- Parameters:
bb- The IoBuffer that will contain the read bytes
-
getShort
short getShort()
- Returns:
- a
shortand advances the reader.
-
getInt
int getInt()
- Returns:
- an
intand advances the reader.
-
getLong
long getLong()
- Returns:
- a
longand advances the reader.
-
getFloat
float getFloat()
- Returns:
- a
floatand advances the reader.
-
getDouble
double getDouble()
- Returns:
- a
doubleand advances the reader.
-
getChar
char getChar()
- Returns:
- a
charand advances the reader.
-
-