Someone told me that we use serialization only to convert object to binary? How far is that correct?
Asked
Active
Viewed 489 times
1
-
Why don't you read the [definition](https://en.wikipedia.org/wiki/Serialization). – Kayaman Nov 07 '15 at 12:34
-
Have a look at my post : http://stackoverflow.com/questions/31524162/use-of-serializable-other-than-writing-reading-object-to-from-file/31541629#31541629 – Ravindra babu Nov 07 '15 at 18:11
2 Answers
0
It is correct
Class to be serialized needs to implement Serializable or Externalizable
You may then use ObjectOutputStream to serialize and ObjectInputStream to deserialize. As these are IO streams they could be abstractions over a file, socket etc.

earcam
- 6,662
- 4
- 37
- 57
0
I don't think the point is converting an object to binary. The only reason why anyone uses serialization is object storage - either in a file or in a database. The object can then be unserialized for later usage.

itoctopus
- 4,133
- 4
- 32
- 44