Package org.apache.mina.util.byteaccess
Interface ByteArray.Cursor
-
- All Superinterfaces:
IoRelativeReader,IoRelativeWriter
- Enclosing interface:
- ByteArray
public static interface ByteArray.Cursor extends IoRelativeReader, IoRelativeWriter
Provides relocatable, relative access to the underlying array. Multiple cursors may be used simultaneously, and cursors will stay consistent with the underlying array, even across modifications. Should this beCloneableto allow cheap mark/position emulation?
-
-
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.intgetIndex()intgetInt()intgetRemaining()booleanhasRemaining()Checks if there are any remaining bytes that can be read.voidsetIndex(int index)Sets the current index of the cursor.
-
-
-
Method Detail
-
getIndex
int getIndex()
- Returns:
- the current index of the cursor.
-
setIndex
void setIndex(int index)
Sets the current index of the cursor. No bounds checking will occur until an access occurs.- Parameters:
index- The current index to set
-
getRemaining
int getRemaining()
- Specified by:
getRemainingin interfaceIoRelativeReader- Specified by:
getRemainingin interfaceIoRelativeWriter- Returns:
- the number of remaining bytes that can be read.
-
hasRemaining
boolean hasRemaining()
Checks if there are any remaining bytes that can be read.- Specified by:
hasRemainingin interfaceIoRelativeReader- Specified by:
hasRemainingin interfaceIoRelativeWriter- Returns:
trueif there are some remaining bytes in the buffer
-
get
byte get()
- Specified by:
getin interfaceIoRelativeReader- Returns:
- the
byteat the current position and advances the reader.
-
get
void get(IoBuffer bb)
Gets enough bytes to fill theIoBufferand advances the reader.- Specified by:
getin interfaceIoRelativeReader- Parameters:
bb- The IoBuffer that will contain the read bytes
-
getInt
int getInt()
- Specified by:
getIntin interfaceIoRelativeReader- Returns:
- an
intand advances the reader.
-
-