Interface IoRelativeReader
- All Known Subinterfaces:
ByteArray.Cursor
- All Known Implementing Classes:
BufferByteArray.CursorImpl, CompositeByteArray.CursorImpl, CompositeByteArrayRelativeReader
public interface IoRelativeReader
Provides relative read access to a sequence of bytes.
-
Method Summary
Modifier and TypeMethodDescriptionbyteget()voidGets enough bytes to fill theIoBufferand advances the reader.chargetChar()doublefloatgetFloat()intgetInt()longgetLong()intshortgetShort()booleanChecks if there are any remaining bytes that can be read.order()voidskip(int length) Advances the reader by the given number of bytes.slice(int length)
-
Method Details
-
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
- 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
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.
-