Package org.apache.mina.util.byteaccess
Interface IoRelativeReader
-
- All Known Subinterfaces:
ByteArray.Cursor
- All Known Implementing Classes:
CompositeByteArrayRelativeReader
public interface IoRelativeReader
Provides 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 byte
get()
void
get(IoBuffer bb)
Gets enough bytes to fill theIoBuffer
and advances the reader.char
getChar()
double
getDouble()
float
getFloat()
int
getInt()
long
getLong()
int
getRemaining()
short
getShort()
boolean
hasRemaining()
Checks if there are any remaining bytes that can be read.ByteOrder
order()
void
skip(int length)
Advances the reader by the given number of bytes.ByteArray
slice(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:
- true if 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
byte
at the current position and advances the reader.
-
get
void get(IoBuffer bb)
Gets enough bytes to fill theIoBuffer
and advances the reader.- Parameters:
bb
- The IoBuffer that will contain the read bytes
-
getShort
short getShort()
- Returns:
- a
short
and advances the reader.
-
getInt
int getInt()
- Returns:
- an
int
and advances the reader.
-
getLong
long getLong()
- Returns:
- a
long
and advances the reader.
-
getFloat
float getFloat()
- Returns:
- a
float
and advances the reader.
-
getDouble
double getDouble()
- Returns:
- a
double
and advances the reader.
-
getChar
char getChar()
- Returns:
- a
char
and advances the reader.
-
-