I’m looking for the alternatives to serialize objects in my Android project. I found Wobly which seem to be fast and small. I understand how to create Wobly wrappers using WoblyImpl but I’m totally confused with how to write/read these objects from the file system? When to run WoblyGenerator and can it be done within my code? Can someone post a code example?
I’m looking for the alternatives to serialize objects in my Android project. I found
Share
Wobly doesn’t support unknown Object fields. So fields like:
cannot be serialized with Wobly.
It supports all primitive classes (and their boxed counterparts), all Wobly classes, any Array/List/Map combination of the above.
So in your case, problem is that
JSONArrayimplementsList<Object>. If you know what kind of objectJSONArrayholds, for exampleList<Map<Integer, String>>, you can write:Though after deserialization you will get
ArrayList<HashMap<Integer,String>>and notJSONArrayback.If you don’t know what object
JSONArrayis holding, it would be painful to make it work with Wobly, if at all possible. You can check out comprehensive comparison of serialization libraries here:https://github.com/eishay/jvm-serializers/wiki