Class CodeInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
de.inetsoftware.classparser.CodeInputStream
- All Implemented Interfaces:
Closeable, DataInput, AutoCloseable
Extends the DataInputStream with a code position.
- Author:
- Volker Berlin
-
Field Summary
Fields inherited from class FilterInputStream
in -
Method Summary
Modifier and TypeMethodDescriptionintGet the code index of the current read position.intLine number in the source code or -1 if not availableintreadUnsignedIndex(boolean wide) Read an unsigned index.Methods inherited from class DataInputStream
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesMethods inherited from class FilterInputStream
available, close, mark, markSupported, read, reset, skipMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Method Details
-
getCodePosition
public int getCodePosition()Get the code index of the current read position.- Returns:
- the position
-
getLineNumber
public int getLineNumber()Line number in the source code or -1 if not available- Returns:
- the line number
-
readUnsignedIndex
Read an unsigned index. For example for a variable.- Parameters:
wide- true, 2 byte index- Returns:
- the unsigned value
- Throws:
IOException- if any I/O errors occur
-