05 Java Serialization Introduction Theory
Rishi Srivastava Serialization is the conversion of the state of an object into a byte stream; deserialization does the opposite. Stated differently, serialization is the conversion of a Java object into a static stream (sequence) of bytes, which we can then save to a database or file or transfer over a network. The reverse operation of serialization is called deserialization where bytestream is converted into a copy of the object. The serialization and deserialization process is platformindependent, it means you can serialize an object on one platform and deserialize it on a different platform. For serializing the object, we call the writeObject() method of ObjectOutputStream class, and for deserialization we call the readObject() method of ObjectInputStream class. We must have to implement the Serializable interface for serializing the object. Java Serialization Playlist: Jav
|
|