Android to Google App Engine serialization exception

允我心安 提交于 2019-12-23 04:11:25

问题


I'm serializing an object graph in the android code and pass result to GAE servlet. While deserializing I sometimes get the following exception:

java.io.StreamCorruptedException: invalid type code: 71

I traced the problem down to one of the fields. If I set it to null or mark as transient the problem disappears. But, if I serialize/deserialize only this field - I don't see any problems as well.

Any ideas?


回答1:


I suggest to use JSON or Google Protocol Buffers instead of own serialization code. It is much easier to extend and maintain. XML is also an option, but it is the slowest to serialize/deserialize and also the least compact format compared to JSON / protobuf.



来源:https://stackoverflow.com/questions/6181055/android-to-google-app-engine-serialization-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!