1 2 package SOFA.SOFAnode.Made.CDL; 3 import java.io.ByteArrayInputStream ; 4 import java.io.File ; 5 import java.io.FileInputStream ; 6 import java.io.ObjectInputStream ; 7 8 import SOFA.SOFAnode.Made.TIR.WorkRepository; 9 10 11 public class NBMain { 12 public static void main(String [] argv) { 13 try { 14 Output.setOut(new ConsoleLogger()); 15 System.setSecurityManager(new java.rmi.RMISecurityManager ()); 16 17 String reference = argv[0]; 18 byte[] bArr = new byte [reference.length() / 2]; 19 for(int i=0;i<reference.length();i+=2) { 20 StringBuffer a = new StringBuffer (); 21 a.append(reference.charAt(i)); 22 a.append(reference.charAt(i+1)); 23 bArr[i/2] = (byte) (Integer.parseInt(a.toString() ,16) - 128); 24 } 25 ObjectInputStream ostr = new ObjectInputStream (new ByteArrayInputStream (bArr)); 26 Object obj = ostr.readObject(); 27 ostr.close(); 28 bArr = null; 29 30 WorkRepository wRep = (WorkRepository) obj; 31 32 Output.out.println(wRep.workIdent()); 33 34 File fname = new File (argv[1]); 35 parser.doParse(new FileInputStream (fname),fname.getName(), null , wRep, false, false ); 36 37 } catch (Exception e) { 38 Output.out.println("Exception: "+e.getMessage()); 39 e.printStackTrace(); 40 System.exit(1); 41 } 42 43 } 44 } 45 | Popular Tags |