Package gnu.bytecode
Class dump
- All Implemented Interfaces:
Closeable
,DataInput
,AutoCloseable
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.classThis 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.-
Field Summary
Fields inherited from class java.io.FilterInputStream
in
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Reads a .class file, and prints out the contents to System.out.static void
process
(InputStream in, String filename, ClassTypeWriter out) static void
process
(InputStream in, String filename, OutputStream out, int flags) static void
process
(InputStream in, String filename, Writer out, int flags) readAttribute
(String name, int length, AttrContainer container) static void
usage
(PrintStream err) Methods inherited from class gnu.bytecode.ClassFileInput
readAttributes, readClassInfo, readClassType, readFields, readFormatVersion, 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.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Method Details
-
readConstants
- Overrides:
readConstants
in classClassFileInput
- Throws:
IOException
-
readAttribute
- Overrides:
readAttribute
in classClassFileInput
- Throws:
IOException
-
process
public static void process(InputStream in, String filename, OutputStream out, int flags) throws IOException - Throws:
IOException
-
process
public static void process(InputStream in, String filename, Writer out, int flags) throws IOException - Throws:
IOException
-
process
- Throws:
IOException
-
main
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
-