Package jminusminus

Class CLInputStream

All Implemented Interfaces:
Closeable, DataInput, AutoCloseable

class CLInputStream extends DataInputStream
This class inherits from java.io.DataInputStream and provides an extra function for reading unsigned int from the input stream, which is required for reading Java class files.
  • Constructor Details

    • CLInputStream

      public CLInputStream(InputStream in)
      Constructs a CLInputStream object from the specified input stream.
      Parameters:
      in - input stream.
  • Method Details

    • readUnsignedInt

      public long readUnsignedInt() throws IOException
      Reads four input bytes and returns a long value in the range 0 through 4294967295. Let a, b, c, d be the four bytes. The value returned is:
         ( b[ 0 ] & 0xFF ) << 24 ) |
         ( ( b[ 1 ] & 0xFF ) << 16 ) |
         ( ( b[ 2 ] & 0xFF ) << 8 ) |
         ( b[ 3 ] & 0xFF )
       
      Returns:
      the unsigned 32-bit value.
      Throws:
      EOFException - if this stream reaches the end before reading all the bytes.
      IOException - if an I/O error occurs.