Code
private MemoryStream serialize_to_stream(String str)
{
try
{
MemoryStream stream = new MemoryStream();
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, str);
return stream;
}
catch
{
return null;
}
}
I want to stop using BinaryFormatter and want to achieve the same result without using BinaryFormatter. Suggest me the Alternatives serialization method which provides the MemoryStream