开发者

BinaryFormatter serialization/deserialization alternative in Android

I have a class serialized in C# using BinaryFo开发者_如何转开发rmatter serialize method. Is there any way i can de-serialize it in android application. I mean is there any alternatives of BinaryFormatter in android?


Have a look on the following URL regarding java seralization against .NET serialization

http://msdn.microsoft.com/en-us/library/e474a3yk%28v=vs.80%29.aspx


Answering my own question after doing some research.

In order to de-serialize objects in android (java) which were serialized in .Net, we have to serialize our class in .Net using custom serialization, i mean by using primitive datatypes instead of using built in .Net serializers. And then android application de-serialize in exact same order using primitive data types.

To summarize we need to write primitive data types on stream in some order and in android read from stream the same primitive data types in exact same order they were written in .Net. XML can also be used for serializing and de-serializing

Hope that helps

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜