What is object serialization? (Java)

Not so technical, what is serialization of an object and its purpose? When should it be used?

(any examples of analogies are welcome)

thanks

+5
source share
6 answers

Serializing objects allows you to convert objects (datastructures) into a binary or other custom view. This, in turn, can be used to send these binary representations over a wire or to store them in a file system.

Serialization can be used to

  • Sending objects over the network
  • Constancy
  • Deepcopy Object Trees
  • ?

Java , , , , Serializable. "", , .

:

+7

, , . . .

+4

:

- - (, xml ..).

Serialized ... ... ... .

+2
+1

. :

Serialization is the conversion of an object to a series of bytes, so that the object can be easily stored for permanent storage or communication. The byte stream can then be deserialized - converted to a replica of the original object.

+1
source

Non-technical: serialization is the process of streaming a memory-based structure (for example, an object that lives normally in main memory) to something permanent, usually on a hard drive. Therefore, you can map the structure of an object to something like XML.

0
source

All Articles