26

Possible Duplicate:
What is object serialization?

Want to get idea behind the serialization and de-serialization of object.A simple example would be appreciated.

2
  • Many questions have already been answered on SO, please use the search - you may find your answer instantly. Apr 14, 2011 at 7:44
  • 1
    FYI, serialization and de-serialization also exists elsewhere, not only in Java ;) Apr 14, 2011 at 7:47

3 Answers 3

26

serialization - Turn data into a stream of bytes

deserialization - Turn a stream of bytes back into a copy of the original object.

2
  • 6
    Right, but when you say turn "data" into a "stream of bytes", what is "data"? Since computers represent everything as bytes, isn't "data" also, well, bytes? So you are transforming some bytes to other bytes. It needs more explanation than that. Oct 5, 2017 at 2:16
  • 3
    @RafaelEyng data is not always in a form which can be streamed. e.g. if you have a object which contains a reference, that reference as bytes is of no use if you stream it. instead you have to stream the data referenced. Oct 5, 2017 at 12:52
6

The objects created in java exists only while Java Virtual Machine is running...

Serialization - saving the created objects in the sequence of bytes...

Deserialization - Retrieving those saved bytes into the form of original object..

This article helps you to understand more... serialization

1
  • The link is not correct I think
    – Harry
    May 20, 2015 at 8:00
3

Serialisation is the process of turning an object into a series of bytes for transferring or storing. Deserialization those same bytes and turns them back into objects.

Not the answer you're looking for? Browse other questions tagged or ask your own question.