All these exceptions are related to serialization which occurred while doing serialization and deserialization of objects. These exceptions are subclasses of ObjectStreamException which is a subclass of IOException.
Pre-requisite:
Exception | Description |
ObjectStreamException | Superclass of all serialization exceptions. |
InvalidClassException | This exception occurred when a class cannot be used to restore/deserialize objects for any of these reasons:
|
NotSerializableException | This exception has thrown by a readObject or writeObject method to terminate serialization or deserialization. |
StreamCorruptedException | This exception has thrown when some of the meta information modified:
|
NotActiveException | This exception has thrown if writeObject state is invalid within the following ObjectOutputStream methods:
This exception has thrown if readObject state is invalid within the following ObjectInputStream methods:
|
InvalidObjectException | This exception occured when a restored object cannot be made valid. |
OptionalDataException | This exception has thrown by readObject when there is primitive data in the stream and an object is expected. The length field of the exception represents the number of bytes that are available in the current block. |
WriteAbortedException | This exception has thrown when reading a stream terminated by an exception that occurred while the stream was being written. |
See Also:
- Java: transient Serialization
- Java: static Serialization
- Java: Externalizable/Custom Serialization
- Java: Object Serialization with Inheritance
- Java: Object Externalizable Serialization with Inheritance
- Java: Array and Collection Serialization
- Java: Serialization Exception Handling
You must log in to post a comment.