Uses of readObject/writeObject in Serialization

后端 未结 5 976
你的背包
你的背包 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:35

    There could be several reasons for using custom serialization:

    1. Performance.
    2. Interfacing with external systems. (Beyond-your-reach or even simply non-Java systems.)
    3. Needing a human-readable format.
    4. Support for older versions of serialized classes.

    To name just a few, but I'm sure there are many more.

提交回复
热议问题