Using readClassDescriptor() and maybe resolveClass() to permit Serialization versioning

前端 未结 5 1975
暗喜
暗喜 2020-12-10 08:11

I am investigating different options in the Java Serialization mechanism to allow flexibility in our class structures for version-tolerant storage (and advocating for a diff

5条回答
  •  长情又很酷
    2020-12-10 08:58

    This is what writeReplace() and readResolve() are for. You're making it much more complicated than it really is. Note that you can define these methods either in the two objects concerned or in subclasses of thee Object stream classes.

提交回复
热议问题