Note
things can get hairy when the underlying buffer is larger than Integer#MAX_VALUE.
Straight forward reading may work, but getPosition() and setPosition(int)
may have problems.
| Modifier and Type | Field and Description |
|---|---|
| private final RandomAccessRead |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: current position.Implements org. Returns the current position. |
| public boolean | Returns: true if there are any bytes left to read.Implements org. Determines if there are any bytes left to read or not. |
| public int | |
| public int | Returns: the unsigned byte as int.offset to the byte to be peeked, must be 0 ≤ offset. offset)Implements org. Peeks one single unsigned byte from the buffer. |
| public byte | Returns: the byte.Implements org. Read one single byte from the buffer. |
| public byte[] | Returns: an array with containing the bytes from the buffer.the number of bytes to be read, must be 0 ≤ length. length)Implements org. Read a number of single byte values from the buffer. |
| public int | Returns: the unsigned byte as int.Implements org. Read one single unsigned byte from the buffer. |
| public void | setPosition(int
the given position, must be 0 ≤ position < length. position)Implements org. Sets the current absolute position to the given value. |
| randomAccessRead | back to summary |
|---|---|
| private final RandomAccessRead randomAccessRead | |
| DataInputRandomAccessRead | back to summary |
|---|---|
| public DataInputRandomAccessRead(RandomAccessRead randomAccessRead) Constructor.
| |
| getPosition | back to summary |
|---|---|
| public int getPosition() throws IOException Implements org. Returns the current position.
| |
| hasRemaining | back to summary |
|---|---|
| public boolean hasRemaining() throws IOException Implements org. Determines if there are any bytes left to read or not.
| |
| length | back to summary |
|---|---|
| public int length() throws IOException Implements org.
| |
| peekUnsignedByte | back to summary |
|---|---|
| public int peekUnsignedByte(int offset) throws IOException Implements org. Peeks one single unsigned byte from the buffer.
| |
| readByte | back to summary |
|---|---|
| public byte readByte() throws IOException Implements org. Read one single byte from the buffer.
| |
| readBytes | back to summary |
|---|---|
| public byte[] readBytes(int length) throws IOException Implements org. Read a number of single byte values from the buffer. Note when
| |
| readUnsignedByte | back to summary |
|---|---|
| public int readUnsignedByte() throws IOException Implements org. Read one single unsigned byte from the buffer.
| |
| setPosition | back to summary |
|---|---|
| public void setPosition(int position) throws IOException Implements org. Sets the current absolute position to the given value. You cannot use
| |