FIM.Util
Class ClassLoaderObjectInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.ObjectInputStream
|
+--FIM.Util.ClassLoaderObjectInputStream
- public class ClassLoaderObjectInputStream
- extends ObjectInputStream
A stream defining the classes which are deserialized not through the standard classloader but
a classloader specified by the user.
- Version:
- 1.0, 1.7.2000
- Author:
- Michael Sonntag
Methods inherited from class java.io.ObjectInputStream |
available,
close,
defaultReadObject,
enableResolveObject,
read,
read,
readBoolean,
readByte,
readChar,
readDouble,
readFields,
readFloat,
readFully,
readFully,
readInt,
readLine,
readLong,
readObject,
readObjectOverride,
readShort,
readStreamHeader,
readUnsignedByte,
readUnsignedShort,
readUTF,
registerValidation,
resolveObject,
skipBytes |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ClassLoaderObjectInputStream
public ClassLoaderObjectInputStream(InputStream in)
throws IOException,
StreamCorruptedException
- Create an ClassLoaderObjectInputStream that reads from the specified InputStream.
- Parameters:
in
- the underlying InputStream- Throws:
- StreamCorruptedException - if the version or magic number are incorrect.
- IOException - if an exception occurred in the underlying stream.
setClassLoader
public final void setClassLoader(ClassLoader classLoader)
- Sets the classloader through which to load the classes.
- Parameters:
classLoader
- the classloader to use when creating objects
getClassLoader
public final ClassLoader getClassLoader()
- Returns the classloader used for laoding the classes in this stream.
Necessary for SignedMessage; it must load the contained class through the classloader it loads itself
- Throws:
- SecurityException - if the caller has no permission to access a classloader (
RuntimePermission("getClassLoader")
) - See Also:
SignedMessage
resolveClass
public Class resolveClass(ObjectStreamClass v)
throws IOException,
ClassNotFoundException
- Load the local class equivalent of the specified stream class description.
This method will be invoked only once for each unique class in the stream.
Once returned, the serialVersionUID of the class is compared to the
serialVersionUID of the serialized class. If there is a mismatch, the
deserialization fails and an exception is raised.
- Parameters:
v
- The definition of the class to resolve (serialized information)- Throws:
- ClassNotFoundException - If the class of a serialized object cannot be found.
- Overrides:
- resolveClass in class ObjectInputStream
Submit a bug
Copyright 2000 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.