gnu.bytecode
Class dump

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

public class dump
extends ClassFileInput

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


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
dump(java.io.InputStream str)
           
 
Method Summary
static void main(java.lang.String[] args)
          Reads a .class file, and prints out the contents to System.out.
 void printAttributes()
           
 Attribute readAttribute(java.lang.String name, int length, AttrContainer container)
           
 ConstantPool readConstants()
           
static void usage()
           
 
Methods inherited from class gnu.bytecode.ClassFileInput
readAttributes, readClassInfo, readClassType, readFields, readHeader, readMethods, skipAttribute
 
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

dump

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

readConstants

public ConstantPool readConstants()
                           throws java.io.IOException
Overrides:
readConstants in class ClassFileInput
Throws:
java.io.IOException

readAttribute

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

printAttributes

public void printAttributes()

main

public static void main(java.lang.String[] args)
Reads a .class file, and prints out the contents to System.out. Very rudimentary - prints out the constant pool, and field and method names and types, but only minimal attributes (i.e. no dis-assembly yet).

Parameters:
args - One argument - the name of a .class file.

usage

public static void usage()