Chapter 4. Serialization

Java serialization allows you to take the state of a Java object and write it into a byte stream. From the stream, you can later create a second Java object that has a state that is equivalent to the state of the original. This facility allows you to persist an instance to a file, transfer an object to another machine on the network, move an object from one class loader to another, or re-create the state of an object against a newer version of the code. In short, serialization lets you make components that are mobile. Several high-level Java technologies build on the backbone of serialization, including Remote Method Invocation (RMI), JavaBeans, Enterprise JavaBeans (EJB), and JINI.

Get Component Development for the Java™ Platform 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.