可序列化简单的java对象用C#反序列化? [英] Can a serialized simple java object be deserialized by C#?
问题描述
假设一个Java类的所有字段是Java原语,如果这样的对象已经系列化,能不能成功地反序列化由C#转换为相当于C#类的一个实例?
Assuming all fields of a java class are java primitives, if such an object has been serialized, can it be successfully deserialized by C# into an instance of an "equivalent" C# class?
时的反向可能? - C#与Java
Is the reverse possible - C# to java?
我知道有许多语言无关的格式,如XML,可能是的使用的把工作完成。我更感兴趣的是是否使用的本机的序列化的数据是可行的。
I realise there are many language agnostic formats, such as XML that could be used to get the job done. I am more interested in whether using the native serialized data is feasible.
推荐答案
可序列化流的格式。我想你可以写一个类容易解析字节流,并创建在C#中所需的类。
The formats of serialized streams are available. I think you can write a class easily to parse the byte stream and create the required class in C#.
这是一篇文章,它指定的序列化格式: http://www.javaworld.com/community/node/2915
An article that specifies the serialized format: http://www.javaworld.com/community/node/2915
这篇关于可序列化简单的java对象用C#反序列化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!