1
18
19 import java.awt.event.*;
20 import java.awt.*;
21 import java.awt.geom.*;
22 import java.util.*;
23 import java.io.*;
24 import java.awt.print.*;
25 import java.awt.image.*;
26 import javax.swing.*;
27 import java.lang.ref.*;
28
29 public class ConvertSymb {
30
31 static public void main(String[] args) {
32
33 ErrorLog log = null;
34
35 try {
36 System.setErr(log=new ErrorLog());
37 } catch (Exception e2) {
38 System.out.println("Trying to set up the error file itself caused an error");
39 System.out.println("RunID = "+Persist.current.getRunID());
40 e2.printStackTrace();
41 }
42
43 Persist.restore();
44 log.logMessage();
45
46 System.out.print(Carto.runversion.getAbout());
47
48 Object result = null;
49 try {
50 FileInputStream istream = new FileInputStream(args[0]);
51 ObjectInputStream in = new ObjectInputStream(istream);
52 result = in.readObject();
53 istream.close();
54 } catch (Exception e) {
55 ErrorLog.log("Symbol file not sucessfully read: "+args[0]);
56 ErrorLog.exception(e);
57 }
58
59 if (! (result instanceof Symbol)) {
60 ErrorLog.log("error: "+args[1]+" did not contain Symbol data.");
61 return;
62 }
63
64
65
66
67 try {
68 FileOutputStream ostream = new FileOutputStream(args[1]);
69 ObjectOutputStream out = new ObjectOutputStream(ostream);
70 out.writeObject(result);
71 ostream.close();
72 } catch (Exception e) {
73 ErrorLog.log("Symbol file not sucessfully written: "+args[1]);
74 ErrorLog.exception(e);
75 }
76 }
77
78 }
79