Java object serialization
Serialization is the conversion of an object to a series of bytes , so that the object can be easily saved to persistent storage or streamed even across other platform or network. The same byte stream can then be deserialized - converted into a replica of the original object. As byte stream create is platform neutral hence once objects created in one system can be deserialized in other platform. It is very useful when you want to transmit one object data across the network, for instance from one JVM to another. Here in Java, the serialization mechanism is built into the platform, but you need to implement the Serializable interface to make an object serializable.
How to read and write Java object from/to a file?
The ObjectOutputStream is used to serialize it and write to a file, while ObjectInputStream can be used in a similar way to read the serialized objects back from file