如何将未序列化的对象序列化或转换为字节数组 [英] How can I Serialize or convert a non serialized object to bytearray
问题描述
大家好
我们正在使用C#和XNA框架进行项目. XNA有许多用于游戏编程的类,但是它具有一些无法序列化的类.例如,我们使用XNA导入和处理3d对象,并希望在运行时保存和加载处理后的对象.我尝试使用XMLformatter和Binaryformatter来序列化我的XNA对象,但它们不会.无论如何,我们想将对象序列化或转换为byteArray,我需要您的帮助..请
B.jedari
Hello Everyone
We are working on a project with C# and XNA framework. XNA has lots of classes for game programming, but it has some classes that they aren''t serializable. For example, We import and process our 3d-objects with XNA and want to save and load the processed objects at run time. I tried with XMLformatter and Binaryformatter to serialize my XNA objects, but they won''t. Anyway, We want to serialize or convert our objects to byteArray and I need your help.. please
B.jedari
推荐答案
您可以简单地使用以下可序列化的适配器:
http://www.vajhoej.dk/arne/eksperten/ser/ser.cs [ ^ ]
http://www.vajhoej.dk/arne/eksperten/ser/ser2.cs [ ^ ]
祝你好运!
You could simply use this serializable adapter:
http://www.vajhoej.dk/arne/eksperten/ser/ser.cs[^]
http://www.vajhoej.dk/arne/eksperten/ser/ser2.cs[^]
Good luck!
这篇关于如何将未序列化的对象序列化或转换为字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!