9.6. Serialization

Serialization is a feature that allows an object’s nontransient state to be stored in a “serialized” form, for example, for the purpose of transporting the object to another machine and then deserializing it, or reconstructing the object, at the destination. RMI uses serialization extensively, as do other packages. Objects are serialized and deserialized via output and input stream classes ObjectOutputStream and ObjectInputStream. Default implementations of two methods, ObjectOutputStream.writeObject and ObjectInputStream.readObject, are invoked for serialization and deserialization, respectively. You also can write, for a serializable class—one that implements the java.io.Serializable interface—writeObject and readObject ...

Get Inside Java™ 2 Platform Security: Architecture, API Design, and Implementation, Second Edition 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.