Android to Google App Engine serialization excepti

2019-06-04 22:35发布

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条回答
Lonely孤独者°
2楼-- · 2019-06-04 23:11

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.

查看更多
登录 后发表回答