ClassDumperpublic final class ClassDumper extends BaseDumper Utility to dump the contents of class files in a human-friendly form. |
Constructors Summary |
---|
private ClassDumper(byte[] bytes, PrintStream out, String filePath, Args args)Constructs an instance. This class is not publicly instantiable.
Use {@link #dump}.
super(bytes, out, filePath, args);
|
Methods Summary |
---|
public static void | dump(byte[] bytes, java.io.PrintStream out, java.lang.String filePath, Args args)Dumps the given array, interpreting it as a class file.
ClassDumper cd =
new ClassDumper(bytes, out, filePath, args);
cd.dump();
| public void | dump()Does the dumping.
byte[] bytes = getBytes();
ByteArray ba = new ByteArray(bytes);
DirectClassFile cf =
new DirectClassFile(ba, getFilePath(), getStrictParse());
cf.setAttributeFactory(StdAttributeFactory.THE_ONE);
cf.setObserver(this);
cf.getMagic(); // Force parsing to happen.
int at = getAt();
if (at != bytes.length) {
parsed(ba, at, bytes.length - at, "<extra data at end of file>");
}
|
|