ObjectInputStream.resolveClass

ObjectInputStream.resolveClass

Class Overview | Class Members | This Package | All Packages

Syntax
protected Class resolveClass( ObjectStreamClass v ) throws IOException, ClassNotFoundException
Description
Subclasses may implement this method to allow classes to be fetched from an alternate source. The corresponding method in ObjectOutputStream is annotateClass. This method will be invoked only once for each unique class in the stream. This method can be implemented by subclasses to use an alternate loading mechanism but must return a Class object. 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.

By default the class name is resolved relative to the class that called readObject.

Exceptions
ClassNotFoundException If class of a serialized object cannot be found.