What is the purpose of Serialization in Java?

前端 未结 8 2371
花落未央
花落未央 2020-11-29 15:29

I have read quite a number of articles on Serialization and how it is so nice and great but none of the arguments were convincing enough. I am wondering if someone can reall

8条回答
  •  春和景丽
    2020-11-29 16:20

    In essense:

    Serialization is the process of converting a set of object instances that contain references to each other into a linear stream of bytes, which can then be sent through a socket, stored to a file, or simply manipulated as a stream of data

    See uses from Wiki:

    Serialization has a number of advantages. It provides:

    1. a method of persisting objects which is more convenient than writing their properties to a text file on disk, and re-assembling them by reading this back in.
    2. a method of issuing remote procedure calls, e.g., as in SOAP
    3. a method for distributing objects, especially in software componentry such as COM, CORBA, etc.
    4. a method for detecting changes in time-varying data.

提交回复
热议问题