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.

Community
  • 1
  • 1
Vral
  • 441
  • 1
  • 4
  • 7

3 Answers3

26

serialization - Turn data into a stream of bytes

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

Community
  • 1
  • 1
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • 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. – Rafael Eyng Oct 05 '17 at 02: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. – Peter Lawrey Oct 05 '17 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

Abhilash
  • 458
  • 2
  • 7
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.

Jeff Foster
  • 43,770
  • 11
  • 86
  • 103