简体   繁体   中英

Java serialization and deserialization on different API levels

I want to store object in file with every sub-object it contains. At first I wanted to use JAXB, but it takes 9MB of disk space - due to my app limited disk space requirement I can not take much of disk space. Thus I thought about serialization and here is my question.

Does different Java versions support the same serialization algorithms?

If I wanted to serialize my object in Java 1.8 would I still be able to deserialize it with Java 1.2 without any problems or data losses?

Of course I am using object validation, app will be running of devices with API 15 to API 21.

我建议您不要担心Java序列化并切换到Gson(或jackson),除非您有充分的理由避免使用它们

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM