Interface SequentialReader
-
- All Known Implementing Classes:
ClassfileReader
public interface SequentialReaderInterface for sequentially reading values in byte order.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description bytereadByte()Read a byte at the current cursor position.intreadInt()Read a int at the current cursor position.longreadLong()Read a long at the current cursor position.shortreadShort()Read a short at the current cursor position.java.lang.StringreadString(int numBytes)Reads the "modified UTF8" format defined in the Java classfile spec.java.lang.StringreadString(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 ";".intreadUnsignedByte()Read an unsigned byte at the current cursor position.longreadUnsignedInt()Read a unsigned int at the current cursor position.intreadUnsignedShort()Read a unsigned short at the current cursor position.voidskip(int bytesToSkip)Skip the given number of bytes.
-
-
-
Method Detail
-
readByte
byte readByte() throws java.io.IOExceptionRead 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.IOExceptionRead 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.IOExceptionRead 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.IOExceptionRead 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.IOExceptionRead 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.IOExceptionRead 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.IOExceptionRead 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.IOExceptionReads 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.IOExceptionReads 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.
-
-