In computer science, serialization is the mapping of structured data onto a sequential form of representation. Serialization is mainly used for storing objects in files and for transferring objects over the network in distributed software systems.
Usual storage media are only able to store data streams . To achieve persistence for an object, it can be serialized. Here, the complete state of the object, including all referenced objects, is converted into a data stream that is then written to a storage medium .
After serialization, an object is available multiple times: as an external representation (e.g. as a file ) and in the main memory . If a change is made to the object in the main memory after serialization, this has no effect on the serialized object in the external representation.
The reverse of serialization, i.e. the conversion of a data stream into objects, is known as deserialization.