c# - How to use Binary Serializing to store as a string? -


Actually I want to serialize MyObject in a string using binary serialization.

Is this possible? If so, how to do it? For deserialization, from strings to MyObject.

I want myObject to be serialized in string using binary serialization

This is a type of contradiction, but you can capture the bytes (memory) stream and convert them into text. Your string course will not be 'readable'. If you want this round to be able to travel, then you have to choose carefully encoding.

String Text = Convert ToBase64String (strm.ToArray ()); // right

and later

  byte [] binary = convert.fobbase 64 string (text); Var strm2 = New system.io Memorystream (binary);  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -