Interface SequentialReader

All Known Implementing Classes:
ClassfileReader

public interface SequentialReader
Interface for sequentially reading values in byte order.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Read a byte at the current cursor position.
    int
    Read a int at the current cursor position.
    long
    Read a long at the current cursor position.
    short
    Read a short at the current cursor position.
    readString(int numBytes)
    Reads the "modified UTF8" format defined in the Java classfile spec.
    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
    Read an unsigned byte at the current cursor position.
    long
    Read a unsigned int at the current cursor position.
    int
    Read a unsigned short at the current cursor position.
    void
    skip(int bytesToSkip)
    Skip the given number of bytes.
  • Method Details

    • readByte

      byte readByte() throws IOException
      Read a byte at the current cursor position.
      Returns:
      The byte at the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • readUnsignedByte

      int readUnsignedByte() throws IOException
      Read an unsigned byte at the current cursor position.
      Returns:
      The unsigned byte at the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • readShort

      short readShort() throws IOException
      Read a short at the current cursor position.
      Returns:
      The short at the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • readUnsignedShort

      int readUnsignedShort() throws IOException
      Read a unsigned short at the current cursor position.
      Returns:
      The unsigned shortat the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • readInt

      int readInt() throws IOException
      Read a int at the current cursor position.
      Returns:
      The int at the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • readUnsignedInt

      long readUnsignedInt() throws IOException
      Read a unsigned int at the current cursor position.
      Returns:
      The int at the current cursor position, as a long.
      Throws:
      IOException - If there was an exception while reading.
    • readLong

      long readLong() throws IOException
      Read a long at the current cursor position.
      Returns:
      The long at the current cursor position.
      Throws:
      IOException - If there was an exception while reading.
    • skip

      void skip(int bytesToSkip) throws IOException
      Skip the given number of bytes.
      Parameters:
      bytesToSkip - The number of bytes to skip.
      Throws:
      IOException - If there was an exception while reading.
    • readString

      String readString(int numBytes, boolean replaceSlashWithDot, boolean stripLSemicolon) throws 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:
      IOException - If an I/O exception occurs.
    • readString

      String readString(int numBytes) throws 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:
      IOException - If an I/O exception occurs.