1

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?

aav
  • 2,514
  • 1
  • 19
  • 27
  • Please provide the type of the variable/access modifier. – Rudy Jun 02 '11 at 15:20
  • public Deuce deuce; (Deuce is an enum). Actually I gave up with native Java object serialization on Android, and already implemented XML based serialization. – aav Jun 02 '11 at 16:07

1 Answers1

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.

uwe
  • 3,931
  • 1
  • 27
  • 19