Package jminusminus
Class CLInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
jminusminus.CLInputStream
- All Implemented Interfaces:
Closeable
,DataInput
,AutoCloseable
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.
-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Constructor Summary
ConstructorDescriptionConstructs a CLInputStream object from the specified input stream. -
Method Summary
Modifier and TypeMethodDescriptionlong
Reads four input bytes and returns along
value in the range 0 through 4294967295.Methods inherited from class java.io.DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytes
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CLInputStream
Constructs a CLInputStream object from the specified input stream.- Parameters:
in
- input stream.
-
-
Method Details
-
readUnsignedInt
Reads four input bytes and returns along
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.
-