Object Serialization

Object serialization is the capability of an object to write out its state to a stream and read it back in again. An object that is serialized writes out all its public and private fields including all fields inherited from all superclasses.

When an object is being serialized and it finds a field that refers to an object or array, serialization will be invoked on that object or array. Serialization is recursive until all fields of an object have been serialized. If an object does not implement the serialization interface, a NotSerializableException exception is thrown.

The java.io package provides for object serialization through the ObjectOutputStream and the ObjectInputStream. These streams provide the methods writeObject ...

Get Borland® JBuilder™ Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.