Interface SequentialReader
-
- All Known Implementing Classes:
ClassfileReader
public interface SequentialReader
Interface for sequentially reading values in byte order.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte
readByte()
Read a byte at the current cursor position.int
readInt()
Read a int at the current cursor position.long
readLong()
Read a long at the current cursor position.short
readShort()
Read a short at the current cursor position.java.lang.String
readString(int numBytes)
Reads the "modified UTF8" format defined in the Java classfile spec.java.lang.String
readString(int numBytes, boolean replaceSlashWithDot, boolean stripLSemicolon)
Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";".int
readUnsignedByte()
Read an unsigned byte at the current cursor position.long
readUnsignedInt()
Read a unsigned int at the current cursor position.int
readUnsignedShort()
Read a unsigned short at the current cursor position.void
skip(int bytesToSkip)
Skip the given number of bytes.
-
-
-
Method Detail
-
readByte
byte readByte() throws java.io.IOException
Read a byte at the current cursor position.- Returns:
- The byte at the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readUnsignedByte
int readUnsignedByte() throws java.io.IOException
Read an unsigned byte at the current cursor position.- Returns:
- The unsigned byte at the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readShort
short readShort() throws java.io.IOException
Read a short at the current cursor position.- Returns:
- The short at the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readUnsignedShort
int readUnsignedShort() throws java.io.IOException
Read a unsigned short at the current cursor position.- Returns:
- The unsigned shortat the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readInt
int readInt() throws java.io.IOException
Read a int at the current cursor position.- Returns:
- The int at the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readUnsignedInt
long readUnsignedInt() throws java.io.IOException
Read a unsigned int at the current cursor position.- Returns:
- The int at the current cursor position, as a long.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
readLong
long readLong() throws java.io.IOException
Read a long at the current cursor position.- Returns:
- The long at the current cursor position.
- Throws:
java.io.IOException
- If there was an exception while reading.
-
skip
void skip(int bytesToSkip) throws java.io.IOException
Skip the given number of bytes.- Parameters:
bytesToSkip
- The number of bytes to skip.- Throws:
java.io.IOException
- If there was an exception while reading.
-
readString
java.lang.String readString(int numBytes, boolean replaceSlashWithDot, boolean stripLSemicolon) throws java.io.IOException
Reads the "modified UTF8" format defined in the Java classfile spec, optionally replacing '/' with '.', and optionally removing the prefix "L" and the suffix ";".- Parameters:
numBytes
- The number of bytes of the UTF8 encoding of the string.replaceSlashWithDot
- If true, replace '/' with '.'.stripLSemicolon
- If true, string final ';' character.- Returns:
- The string.
- Throws:
java.io.IOException
- If an I/O exception occurs.
-
readString
java.lang.String readString(int numBytes) throws java.io.IOException
Reads the "modified UTF8" format defined in the Java classfile spec.- Parameters:
numBytes
- The number of bytes of the UTF8 encoding of the string.- Returns:
- The string.
- Throws:
java.io.IOException
- If an I/O exception occurs.
-
-