org.apache.commons.io.input
Class ClassLoaderObjectInputStream
ObjectInputStream
org.apache.commons.io.input.ClassLoaderObjectInputStream
public class ClassLoaderObjectInputStream
extends ObjectInputStream
A special ObjectInputStream that loads a class based on a specified
ClassLoader
rather than the system default.
This is useful in dynamic container environments.
$Id: ClassLoaderObjectInputStream.java 437567 2006-08-28 06:39:07Z bayard $
protected Class | resolveClass(ObjectStreamClass objectStreamClass) - Resolve a class specified by the descriptor using the
specified ClassLoader or the super ClassLoader.
|
classLoader
private ClassLoader classLoader
The class loader to use.
ClassLoaderObjectInputStream
public ClassLoaderObjectInputStream(ClassLoader classLoader,
InputStream inputStream)
throws IOException,
StreamCorruptedException
Constructs a new ClassLoaderObjectInputStream.
classLoader
- the ClassLoader from which classes should be loadedinputStream
- the InputStream to work on
resolveClass
protected Class resolveClass(ObjectStreamClass objectStreamClass)
throws IOException,
ClassNotFoundException
Resolve a class specified by the descriptor using the
specified ClassLoader or the super ClassLoader.
objectStreamClass
- descriptor of the class
- the Class object described by the ObjectStreamClass