gnu.bytecode
Class dump
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
java.io.DataInputStream
gnu.bytecode.ClassFileInput
gnu.bytecode.dump
- All Implemented Interfaces:
- java.io.Closeable, java.io.DataInput
public class dump
- extends ClassFileInput
Application to read a ClassType from a DataInputStream (.class file).
To print out the contents of a class file foo.class, you can use
the class dump as an application:
java gnu.bytecode.dump foo.class
This will print out the constant pool, fields, methods, superclass,
and implemented interfaces of class foo.
It is useful for printing out more detailed information
than javap does.
| Fields inherited from class java.io.FilterInputStream |
in |
|
Method Summary |
static void |
main(java.lang.String[] args)
Reads a .class file, and prints out the contents to System.out. |
static void |
process(java.io.InputStream in,
java.lang.String filename,
ClassTypeWriter out)
|
static void |
process(java.io.InputStream in,
java.lang.String filename,
java.io.OutputStream out,
int flags)
|
static void |
process(java.io.InputStream in,
java.lang.String filename,
java.io.Writer out,
int flags)
|
Attribute |
readAttribute(java.lang.String name,
int length,
AttrContainer container)
|
ConstantPool |
readConstants()
|
static void |
usage(java.io.PrintStream err)
|
| 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 |
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
process
public static void process(java.io.InputStream in,
java.lang.String filename,
java.io.OutputStream out,
int flags)
throws java.io.IOException
- Throws:
java.io.IOException
process
public static void process(java.io.InputStream in,
java.lang.String filename,
java.io.Writer out,
int flags)
throws java.io.IOException
- Throws:
java.io.IOException
process
public static void process(java.io.InputStream in,
java.lang.String filename,
ClassTypeWriter out)
throws java.io.IOException
- Throws:
java.io.IOException
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(java.io.PrintStream err)