Rohan Maity
02/03/2022, 4:05 PMSerializable
of java ?
why I am asking this question, actually we need to store the some serialized data in local/Room DB
With Java's Serializable, problem is if we make any changes to the class implementing Serializable,. Its serialVersionUID
gets changed, which causes the problem in deserializingCasey Brooks
02/03/2022, 4:10 PMSerializable
is an internal format that is only useful within Java, and kotlinx.serialization has no interop or compatibility with it.
Note that you can have a class be "serializable" with both Kotlinx.serialization, and also by the Java interface.Casey Brooks
02/03/2022, 4:15 PMSerializable
for any reason other than marshalling data around your application. Because of its serialVersionUID
and the fact that the serialized representation is so closely linked with the Class binary, it's not really meant to persist serialized state over time.
In contrast, the standard formats like JSON are very-much designed to be parsed at a later date, with changes to the class/schema that originally produced it, or even to pass into other programming languages.Rohan Maity
02/03/2022, 4:17 PMRohan Maity
02/03/2022, 4:18 PMSerialVersionUID
I just got to know this TodayRohan Maity
02/03/2022, 4:18 PM