1 package org.ozoneDB.io.stream; 9 10 import java.io.ObjectInputStream ; 11 import java.io.InputStream ; 12 import java.io.IOException ; 13 import java.io.ObjectStreamClass ; 14 15 19 public class ResolvingObjectInputStream extends ObjectInputStream { 20 21 public ResolvingObjectInputStream(InputStream in) throws IOException { 22 super(in); 23 } 24 25 protected Class resolveClass(ObjectStreamClass desc) 26 throws IOException , ClassNotFoundException { 27 28 ClassLoader cl = Thread.currentThread().getContextClassLoader(); 29 if (cl != null) { 30 try { 31 return cl.loadClass(desc.getName()); 32 } 33 catch (ClassNotFoundException e) { 34 } 35 } 36 return super.resolveClass(desc); 37 } 38 } 39 | Popular Tags |