private class CompositeByteArray.CursorImpl extends java.lang.Object implements ByteArray.Cursor
| Modifier and Type | Field and Description |
|---|---|
private ByteArray.Cursor |
componentCursor |
private int |
componentIndex |
private ByteArrayList.Node |
componentNode |
private int |
index |
private CompositeByteArray.CursorListener |
listener |
| Constructor and Description |
|---|
CursorImpl() |
CursorImpl(CompositeByteArray.CursorListener listener) |
CursorImpl(int index) |
CursorImpl(int index,
CompositeByteArray.CursorListener listener) |
| Modifier and Type | Method and Description |
|---|---|
byte |
get()
Gets a
byte and advances the reader. |
void |
get(IoBuffer bb)
Gets enough bytes to fill the
IoBuffer and advances the reader. |
char |
getChar()
Gets a
char and advances the reader. |
double |
getDouble()
Gets a
double and advances the reader. |
float |
getFloat()
Gets a
float and advances the reader. |
int |
getIndex()
Gets the current index of the cursor.
|
int |
getInt()
Gets an
int and advances the reader. |
long |
getLong()
Gets a
long and advances the reader. |
int |
getRemaining()
Gets the number of remaining bytes that can be read.
|
short |
getShort()
Gets a
short and advances the reader. |
boolean |
hasRemaining()
Checks if there are any remaining bytes that can be read.
|
java.nio.ByteOrder |
order()
Gets the order of the bytes.
|
private void |
prepareForAccess(int accessSize) |
void |
put(byte b)
Puts a
byte and advances the reader. |
void |
put(IoBuffer bb)
Puts enough bytes to fill the
IoBuffer and advances the reader. |
void |
putChar(char c)
Puts a
char and advances the reader. |
void |
putDouble(double d)
Puts a
double and advances the reader. |
void |
putFloat(float f)
Puts a
float and advances the reader. |
void |
putInt(int i)
Puts an
int and advances the reader. |
void |
putLong(long l)
Puts a
long and advances the reader. |
void |
putShort(short s)
Puts a
short and advances the reader. |
void |
setIndex(int index)
Sets the current index of the cursor.
|
void |
skip(int length)
Advances the reader by the given number of bytes.
|
ByteArray |
slice(int length)
Creates an array with a view of part of this array.
|
private int index
private final CompositeByteArray.CursorListener listener
private ByteArrayList.Node componentNode
private int componentIndex
private ByteArray.Cursor componentCursor
public CursorImpl()
public CursorImpl(int index)
public CursorImpl(CompositeByteArray.CursorListener listener)
public CursorImpl(int index,
CompositeByteArray.CursorListener listener)
public int getIndex()
ByteArray.CursorgetIndex in interface ByteArray.Cursorpublic void setIndex(int index)
ByteArray.CursorsetIndex in interface ByteArray.Cursorpublic void skip(int length)
IoRelativeReaderskip in interface IoRelativeReaderskip in interface IoRelativeWriterpublic ByteArray slice(int length)
IoRelativeReaderslice in interface IoRelativeReaderpublic java.nio.ByteOrder order()
IoRelativeReaderorder in interface IoRelativeReaderorder in interface IoRelativeWriterprivate void prepareForAccess(int accessSize)
public int getRemaining()
IoRelativeReadergetRemaining in interface ByteArray.CursorgetRemaining in interface IoRelativeReadergetRemaining in interface IoRelativeWriterpublic boolean hasRemaining()
IoRelativeReaderhasRemaining in interface ByteArray.CursorhasRemaining in interface IoRelativeReaderhasRemaining in interface IoRelativeWriterpublic byte get()
IoRelativeReaderbyte and advances the reader.get in interface ByteArray.Cursorget in interface IoRelativeReaderpublic void put(byte b)
IoRelativeWriterbyte and advances the reader.put in interface IoRelativeWriterpublic void get(IoBuffer bb)
IoRelativeReaderIoBuffer and advances the reader.get in interface ByteArray.Cursorget in interface IoRelativeReaderpublic void put(IoBuffer bb)
IoRelativeWriterIoBuffer and advances the reader.put in interface IoRelativeWriterpublic short getShort()
IoRelativeReadershort and advances the reader.getShort in interface IoRelativeReaderpublic void putShort(short s)
IoRelativeWritershort and advances the reader.putShort in interface IoRelativeWriterpublic int getInt()
IoRelativeReaderint and advances the reader.getInt in interface ByteArray.CursorgetInt in interface IoRelativeReaderpublic void putInt(int i)
IoRelativeWriterint and advances the reader.putInt in interface IoRelativeWriterpublic long getLong()
IoRelativeReaderlong and advances the reader.getLong in interface IoRelativeReaderpublic void putLong(long l)
IoRelativeWriterlong and advances the reader.putLong in interface IoRelativeWriterpublic float getFloat()
IoRelativeReaderfloat and advances the reader.getFloat in interface IoRelativeReaderpublic void putFloat(float f)
IoRelativeWriterfloat and advances the reader.putFloat in interface IoRelativeWriterpublic double getDouble()
IoRelativeReaderdouble and advances the reader.getDouble in interface IoRelativeReaderpublic void putDouble(double d)
IoRelativeWriterdouble and advances the reader.putDouble in interface IoRelativeWriterpublic char getChar()
IoRelativeReaderchar and advances the reader.getChar in interface IoRelativeReaderpublic void putChar(char c)
IoRelativeWriterchar and advances the reader.putChar in interface IoRelativeWriter