home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-05-22 | 967 b | 36 lines |
- /*
- * dumpclass.java
- *
- * Uses the class file decoders in util to dump out a
- * class file.
- * Written : 22 - May - 1996 by Chuck McManis
- */
-
- import util.*;
- import java.io.*;
-
- public class dumpclass {
- public static void main(String args[]) {
- FileInputStream fis;
- ClassFile cf = new ClassFile();
- cf.debug = true;
-
-
- /* Try to open arg[0] as the name of a .class file */
- try { fis = new FileInputStream(args[0]); }
- catch (IOException e) { fis = null; }
-
- try {
- /* Read in the .class file (can throw various things) */
- if (! cf.read(fis)) {
- System.out.println("Couldn't load "+args[0]+", press a key.");
- int c = System.in.read(); /* this is for Symantec */
- throw new Exception("File not parsed.");
- }
-
- cf.display(System.out);
- int c = System.in.read(); /* Keep screen open */
- } catch (Exception e) { }
- }
- }
-