Data structures or object states can be transformed using the serialization and deserialization procedures into a format that can be transferred, saved, and rebuilt.
- Serialization: The state of an object converting to a byte stream.
- De-serialization: Reverse process in Serialization. Byte stream convert to actual java object in memory.
- Data persistence : To save an object in database
- Communication : To exchange data between different part of system or between different network.(To travel Object across a network)
- Performance : Improve data storage(Memory) efficiently.
Serialization :
- Create an object : An object is create using program.
- Serialization : Convert object to byte stream using created object (Can we use Json,XML or Binary).
- Storage : Converted byte stream store in a file , database or over network.
De-serialization :
- Byte stream retrieval : Get byte stream from storage(file,database or over network).
- De-serialization : Convert byte stream to back on that object using got byte from storage.
- Usage of Object : Use that object in program