What is the easiest way to do binary serialization/deserialization of some custom data between C# and Android's Java? I'd like to find for Java something similar to C# BinaryWriter and BinaryReader - which supports writing primitives (like uint16) and UTF-8 strings.
Or maybe there is a better way?
edit: structure of the data is not know at compilation time
Sample write:
BinaryWriter w = new BinaryWriter(File.OpenWrite(@"D:\data"));
w.Write((UInt16)1234);
w.Write("To jest żółwiątko");
w.Write((UInt16)4567);