Uses of readObject/writeObject in Serialization

后端 未结 5 975
你的背包
你的背包 2020-12-01 22:02

I was going through this article to understand more about Java Serialization process. When it comes to uses of readObject/writeObject I could see two use cases:

5条回答
  •  温柔的废话
    2020-12-01 22:18

    You can implement you own readObject/writeObject for performance reasons, or backward compatibility reasons, or because a field you want to serialize is not Serializable.

    For good examples of readObject/writeObject I would look in the source which comes with the JDK. Or I would try http://www.google.co.uk/search?q=readObject+writeObject+examples

提交回复
热议问题