| Modifier and Type | Field and Description |
|---|---|
| public static final int | EOF
yet another definition of eof of file as -1 |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: offset of the next byte to readreturns the current position of the reader in the underlying byte buffer |
| public void | position(int
offset to position the reader to newPosition)sets the position of the reader so that it will read the byte at the passed in offset (newPosition) on the next call to read() |
| public int | Returns: next byte of datareads a single byte and returns it as an unsigned value, that is from 0 to 255. |
| public int | Returns: number of bytes actually copiedcallers destination byte array dst, int offset of the first destination array element to write into start, int maximum number of bytes to copy len)reads a number of bytes into the callers supplied buffer (dst). |
| public Decimal | Returns: Decimal object initialized to the represented value; not null.number of bytes over which the value extends len)reads the next len bytes and converts them to a |
| public double | Returns: 0.0 or the double represented by the next 8 bytes0 or 8 len)reads len bytes and treats them as an IEEE 64 binary floating point value. |
| public String | Returns: resultant Java stringnumber of bytes to read len)reads the next len bytes and converts them from UTF-8 into Java characters and returns those characters as a String. |
| public Timestamp | |
| public int | |
| public long | Returns: long value readnumber of bytes to read into the long len)reads the next len bytes as a signed long. |
| public int | |
| public long | |
| public int | |
| public long | |
| public void |
| EOF | back to summary |
|---|---|
| public static final int EOF yet another definition of eof of file as -1 | |
| position | back to summary |
|---|---|
| public int position() returns the current position of the reader in the underlying byte buffer
| |
| position | back to summary |
|---|---|
| public void position(int newPosition) sets the position of the reader so that it will read the byte at the passed in offset (newPosition) on the next call to read()
| |
| read | back to summary |
|---|---|
| public int read() throws IOException reads a single byte and returns it as an unsigned value, that is from 0 to 255. This returns a ByteReader.EOF (-1) if there is not data to read.
| |
| read | back to summary |
|---|---|
| public int read(byte[] dst, int start, int len) throws IOException reads a number of bytes into the callers supplied buffer (dst). This will return the number of bytes read, if any.
| |
| readDecimal | back to summary |
|---|---|
| public Decimal readDecimal(int len) throws IOException reads the next len bytes and converts them to a
| |
| readFloat | back to summary |
|---|---|
| public double readFloat(int len) throws IOException reads len bytes and treats them as an IEEE 64 binary floating point value. Currently the only valid values for len are 0 (which returns 0.0e1) or 8 which is treated as a 64 bit binary float and returned.
| |
| readString | back to summary |
|---|---|
| public String readString(int len) throws IOException reads the next len bytes and converts them from UTF-8 into Java characters and returns those characters as a String. This may throw an exception in the event it encounters byte sequences that are not value UTF-8. This converts some Unicode values into character pairs when the value requires the use of surrogate pairs in Unicode 16.
| |
| readTimestamp | back to summary |
|---|---|
| public Timestamp readTimestamp(int len) throws IOException Reads the next len bytes and returns them as a | |
| readTypeDesc | back to summary |
|---|---|
| public int readTypeDesc() throws IOException reads the next byte as a typedesc bytes
| |
| readULong | back to summary |
|---|---|
| public long readULong(int len) throws IOException reads the next len bytes as a signed long. This uses 8 bits per byte and expects the bytes in bigendian order. It returns the aggregated bytes as a Java long (signed 64 bit value).
| |
| readVarInt | back to summary |
|---|---|
| public int readVarInt() throws IOException reads the upcoming bytes as a signed int. This uses 7 bits per byte, expects the bytes in bigendian order, and looks for the high order bit (0x80) to be set to mark the end of the value. It expects the 2nd bit (0x40 of the first byte) to be the sign of the value. The remaining bits are the absolute value of the orginal value. It returns the aggregated bytes as a Java long (signed 32 bit value) correctly signed.
| |
| readVarLong | back to summary |
|---|---|
| public long readVarLong() throws IOException reads the upcoming bytes as a signed long. This uses 7 bits per byte, expects the bytes in bigendian order, and looks for the high order bit (0x80) to be set to mark the end of the value. It expects the 2nd bit (0x40 of the first byte) to be the sign of the value. The remaining bits are the absolute value of the orginal value. It returns the aggregated bytes as a Java long (signed 64 bit value) correctly signed.
| |
| readVarUInt | back to summary |
|---|---|
| public int readVarUInt() throws IOException reads the upcoming bytes as a unsigned int. This uses 7 bits per byte, expects the bytes in bigendian order, and looks for the high order bit (0x80) to be set to mark the end of the value. It does not include a sign bit so all 7 bits in the first byte are treated as positive. It returns the aggregated bytes as a Java long (signed 32 bit value).
| |
| readVarULong | back to summary |
|---|---|
| public long readVarULong() throws IOException reads the upcoming bytes as a unsigned long. This uses 7 bits per byte, expects the bytes in bigendian order, and looks for the high order bit (0x80) to be set to mark the end of the value. It does not include a sign bit so all 7 bits in the first byte are treated as positive. It returns the aggregated bytes as a Java long (signed 64 bit value).
| |
| skip | back to summary |
|---|---|
| public void skip(int length) moves the reader forward length bytes. This is typically faster than read as it has no need to actually move any bytes of data. It may error if the skip would take the current position off the end of the buffer.
| |