gnu.bytecode
Class ClassFileInput

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.DataInputStream
              extended by gnu.bytecode.ClassFileInput
All Implemented Interfaces:
java.io.Closeable, java.io.DataInput
Direct Known Subclasses:
dump

public class ClassFileInput
extends java.io.DataInputStream

Class to read a ClassType from a DataInputStream (.class file).


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ClassFileInput(ClassType ctype, java.io.InputStream str)
           
ClassFileInput(java.io.InputStream str)
           
 
Method Summary
 Attribute readAttribute(java.lang.String name, int length, AttrContainer container)
           
 int readAttributes(AttrContainer container)
           
 void readClassInfo()
           
static ClassType readClassType(java.io.InputStream str)
          Read a class (in .class format) from an InputStream.
 ConstantPool readConstants()
           
 void readFields()
           
 boolean readHeader()
           
 void readMethods()
           
 void skipAttribute(int length)
           
 
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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileInput

public ClassFileInput(java.io.InputStream str)
               throws java.io.IOException
Throws:
java.io.IOException

ClassFileInput

public ClassFileInput(ClassType ctype,
                      java.io.InputStream str)
               throws java.io.IOException,
                      java.lang.ClassFormatError
Throws:
java.io.IOException
java.lang.ClassFormatError
Method Detail

readClassType

public static ClassType readClassType(java.io.InputStream str)
                               throws java.io.IOException,
                                      java.lang.ClassFormatError
Read a class (in .class format) from an InputStream.

Returns:
A new ClassType object representing the class that was read.
Throws:
java.io.IOException
java.lang.ClassFormatError

readHeader

public boolean readHeader()
                   throws java.io.IOException
Throws:
java.io.IOException

readConstants

public ConstantPool readConstants()
                           throws java.io.IOException
Throws:
java.io.IOException

readClassInfo

public void readClassInfo()
                   throws java.io.IOException
Throws:
java.io.IOException

readAttributes

public int readAttributes(AttrContainer container)
                   throws java.io.IOException
Throws:
java.io.IOException

skipAttribute

public final void skipAttribute(int length)
                         throws java.io.IOException
Throws:
java.io.IOException

readAttribute

public Attribute readAttribute(java.lang.String name,
                               int length,
                               AttrContainer container)
                        throws java.io.IOException
Throws:
java.io.IOException

readFields

public void readFields()
                throws java.io.IOException
Throws:
java.io.IOException

readMethods

public void readMethods()
                 throws java.io.IOException
Throws:
java.io.IOException