public static ObjectInputStream newObjectInputStream ( InputStream inputStream , final ClassLoader classLoader ) throws IOException { return new ObjectInputStream ( inputStream ) { protected Class < ? > resolveClass ( ObjectStreamClass desc ) throws IOException , ClassNotFoundException { return Class . forName ( desc . getName ( ) , true , classLoader ) ; } } ; }
Create an object input stream for this input stream using the given class loader .