FIM.Util
Class ClassLoaderObjectInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.ObjectInputStream
|
+--FIM.Util.ClassLoaderObjectInputStream
- All Implemented Interfaces:
- DataInput, ObjectInput, ObjectStreamConstants
- 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
Fields inherited from interface java.io.ObjectStreamConstants |
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING |
Methods inherited from class java.io.ObjectInputStream |
available, bufferData, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveObject, resolveProxyClass, 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.
- Overrides:
resolveClass
in class ObjectInputStream
- Parameters:
v
- The definition of the class to resolve (serialized information)- Throws:
ClassNotFoundException
- If the class of a serialized object cannot be found.
Submit a bug
Copyright 2001,2002 Michael Sonntag & Institute for Information Processing and Microprocessor Technology (FIM), Johannes-Kepler-University Linz, Altenbergerstr. 69, A-4040 Linz, Austria.