All exceptions thrown by serialization classes are subclasses of ObjectStreamException which is a subclass of IOException.
ObjectStreamExceptionSuperclass of all serialization exceptions.
InvalidClassExceptionThrown when a class cannot be used to restore objects for any of these reasons:
Externalizable class does not have a public no-arg constructor.Serializable class can not access the no-arg constructor of its closest non-Serializable superclass.NotSerializableExceptionThrown by a readObject or writeObject method to terminate serialization or deserialization.
StreamCorruptedExceptionThrown:
readExternal on a PROTOCOL_VERSION_2 stream.NotActiveExceptionThrown if writeObject state is invalid within the following ObjectOutputStream methods:
defaultWriteObjectputFieldswriteFieldsThrown if readObject state is invalid within the following ObjectInputStream methods:
defaultReadObjectreadFieldsregisterValidationInvalidObjectExceptionThrown when a restored object cannot be made valid.
OptionalDataExceptionThrown by readObject when there is primitive data in the stream and an object is expected. The length field of the exception indicates the number of bytes that are available in the current block.
WriteAbortedExceptionThrown when reading a stream terminated by an exception that occurred while the stream was being written.
Copyright © 2005, 2017, Oracle and/or its affiliates. All rights reserved.
CONTENTS | PREV | NEXT