序列化 serialization

Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.

JAVA中实现serialization主要靠两个类:

  • ObjectOuputStream
  • ObjectInputStream

他们是JAVA IO系统里的OutputStream和InputStream的子类

自定义序列化的作用如下:

  1. Persist only meaningful data.
  2. Manage serialization between different versions of your class.
  3. Avoid exposing the serialization mechanism to client API.

Reference

以上内容是否对您有帮助:
停课不停学活动
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部