推荐答案
来自这个序列化的内容是什么?:
它允许你获取一个对象或一组对象,将它们放在磁盘上或通过有线或无线传输机制发送,然后再用另一个计算机,反向过程:恢复原来的对象。基本机制是将将对象展平为一维比特流,并将转换回原始对象的比特流。
It lets you take an object or group of objects, put them on a disk or send them through a wire or wireless transport mechanism, then later, perhaps on another computer, reverse the process: resurrect the original object(s). The basic mechanisms are to flatten object(s) into a one-dimensional stream of bits, and to turn that stream of bits back into the original object(s).
就像星际迷航中的转运者一样,所有这些都是关于将复杂化并将其变为平坦的序列的1s和0,然后取序列1和0(可能在另一个地方,可能在另一个时间)并重建原始的复杂的东西。
Like the Transporter on Star Trek, it's all about taking something complicated and turning it into a flat sequence of 1s and 0s, then taking that sequence of 1s and 0s (possibly at another place, possibly at another time) and reconstructing the original complicated "something."
因此,当您需要存储对象的副本时,实现 Serializable 界面,将它们发送到另一个在同一系统或网络上运行的进程。
So, implement the Serializable interface when you need to store a copy of the object, send them to another process which runs on the same system or over the network.
因为你想存储或发送一个对象。
Because you want to store or send an object.
它使存储和发送对象变得容易。它与安全性无关。
It makes storing and sending objects easy. It has nothing to do with security.
更多推荐
什么时候应该实现Serializable接口?
发布评论