1 15 16 package javassist; 17 18 import java.io.*; 19 import javassist.bytecode.ClassFile; 20 import javassist.bytecode.ClassFileWriter; 21 22 33 public class Dump { 34 private Dump() {} 35 36 41 public static void main(String [] args) throws Exception { 42 if (args.length != 1) { 43 System.err.println("Usage: java Dump <class file name>"); 44 return; 45 } 46 47 DataInputStream in = new DataInputStream( 48 new FileInputStream(args[0])); 49 ClassFile w = new ClassFile(in); 50 PrintWriter out = new PrintWriter(System.out, true); 51 out.println("*** constant pool ***"); 52 w.getConstPool().print(out); 53 out.println(); 54 out.println("*** members ***"); 55 ClassFileWriter.print(w, out); 56 } 57 } 58 | Popular Tags |