i have a person object and need to store it as byte[] and again retrieve that byte[] and convert to person object and BinaryFormatter is not availabe in silverlight
相关问题
- Do the Java Integer and Double objects have unnece
- Converting a string array to a byte array
- How do I create a multidimensional array of object
- how to Enumerate local fonts in silverlight 4
- Free Silverlight mapping with Bing maps and OpenSt
相关文章
- Poor Use Case of Object.assign() - Simple Example
- Where is the object browser in visual studio C# 20
- New Windows Application - What language?
- Implementation Strategies for Object Orientation
- An object reference is required for the non-static
- relative url in wcf service binding
- Embedded images not showing when in a UserControl
- Reader interface and the Read method in golang
Use the serialized class to convert the object into a byte via using a MemoryStream
Hope this helps, Best regards, Tom.
Because the namespaces mentioned by t0mm13b are not part of the Silverlight .NET engine, the correct way to is to use this workaround leveraging the data contract serializer:
http://forums.silverlight.net/forums/t/23161.aspx
From the link:
If you really need binary and want it to be super fast and very small, then you should use protobuf from Google.
http://code.google.com/p/protobuf-net/
Look at these performance numbers. Protobuf is far and away the fastest and smallest.
I've used it for WCF <--> Silverlight with success and would not hesitate to use it again for a new project.
Look at custom binary serialization and compression here
and here
I have used XML Serializer to convert the object to a string and them convert the string to byte[] successfully in Silverlight.