一、什么是序列化
In computer science, in the context of data storage, serialization is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer, or transmitted across a network connection link) and reconstructed later in the same or another computer environment.[1] When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object.
那我也有看过很多的博客包括书,但是我之前其实一直不太理解这个序列化,虽然一直都在用。今天在看资料 的时候,发现导致这种现象的原因,可能是我之前看的一些介绍里面,忽略了一个很关键的因素:object state info对象的状态信息 。也就是说,其实序列化,它是完整的保存了某一状态下的对象信息,是一个整体,而不是零散的!我在一个IBM工程师的博客里面看到一个说法,我感觉对于我理解序列化很有帮助,他说序列化的过程,就是一个“freeze”的过程,它将一个对象freeze住,然后进行存储,等到再次需要的时候,再将这个对象de-freeze就可以立即使用。
二、为什么需要序列化
1&#