1 19 20 package org.netbeans.modules.dbschema.migration.archiver; 21 22 import org.netbeans.modules.dbschema.migration.archiver.deserializer.XMLGraphDeserializer; 23 24 import org.xml.sax.*; 25 26 import java.io.InputStream ; 27 28 33 public class XMLInputStream extends java.io.DataInputStream implements java.io.ObjectInput 34 { 35 36 private InputStream inStream; 37 private ClassLoader classLoader; 38 39 41 public XMLInputStream(InputStream in, 42 ClassLoader cl) 43 { 44 super(in); 45 this.inStream = in; 46 this.classLoader = cl; 47 } 48 49 50 public XMLInputStream(InputStream in) 51 { 52 this (in, null); 53 } 54 55 public java.lang.Object readObject() throws java.lang.ClassNotFoundException , java.io.IOException 56 { 57 58 try 59 { 60 61 XMLGraphDeserializer lSerializer = new XMLGraphDeserializer(this.classLoader); 62 lSerializer.Begin(); 63 InputSource input = new InputSource(this.inStream); 64 input.setSystemId("archiverNoID"); 65 66 lSerializer.setSource(input); 67 68 return lSerializer.XlateObject(); 69 } 70 catch (SAXException lError) 71 { 72 lError.printStackTrace(); 73 java.io.IOException lNewError = new java.io.IOException (lError.getMessage()); 74 throw lNewError; 75 } 76 } 77 78 } 79 | Popular Tags |