1 21 22 package org.apache.derby.iapi.services.io; 23 24 import org.apache.derby.iapi.services.loader.ClassFactory; 25 26 import java.io.ObjectStreamClass ; 27 import java.io.ObjectInputStream ; 28 import java.io.IOException ; 29 import java.io.InputStream ; 30 31 35 class ApplicationObjectInputStream extends ObjectInputStream 36 implements ErrorObjectInput 37 { 38 39 protected ClassFactory cf; 40 protected ObjectStreamClass initialClass; 41 42 ApplicationObjectInputStream(InputStream in, ClassFactory cf) 43 throws IOException { 44 super(in); 45 this.cf = cf; 46 } 47 48 protected Class resolveClass(ObjectStreamClass v) 49 throws IOException , ClassNotFoundException { 50 51 if (initialClass == null) 52 initialClass = v; 53 54 if (cf != null) 55 return cf.loadApplicationClass(v); 56 57 throw new ClassNotFoundException (v.getName()); 58 } 59 60 public String getErrorInfo() { 61 if (initialClass == null) 62 return ""; 63 64 return initialClass.getName() + " (serialVersionUID=" 65 + initialClass.getSerialVersionUID() + ")"; 66 } 67 68 public Exception getNestedException() { 69 return null; 70 } 71 72 } 73 | Popular Tags |