I\'m working on a project where I\'ll need to serialize some data in a java 6 app and deserialize it a c# 2.0 app. Is there a strategy or something already in existence I c
You can use the wox cross platform serialization library (https://github.com/codelion/wox), it is based on native XML serializers for Java and C#.
I don't believe binary serialization will work as C# and Java have no idea of each others native types.
Protocol Buffers (Google Site)
Java Tutorial
Jon Skeet's C# Port
Marc Gravell's C# Port
Upsides: Fast and you can bug quite some people that are involved with this thing on SO.. ;-)
Let me exploit Marc's project site: Performance is quite acceptable..
you can use BSON if you really need the data as binary...
http://bsonspec.org/implementations.html
I'll echo most of the other answers here as far as Google protocol buffers is concerned. But I ended up using a program called protostuff at the Java end instead of Google's own Java implementation, and I also added the name of the (outermost) class as a prefix to the protocol buffers data to make the data self-describing for deserialization. Details here: https://stackoverflow.com/a/17923846/253938
The default binary serialization of each language is incompatible so you will not be able to use that.
There are many cross-language serialization technologies that support Java, C#, and other languages:
Of these, JSON is not binary but very efficient for a string-based language. Thrift and Protocol Buffers are binary and have a very compact representation.