rendered paste bodypublic static byte[] GetSerializedObject(object obj)
{
MemoryStream outputStream = new MemoryStream();
BinaryFormatter bFormatter = new BinaryFormatter();
bFormatter.Serialize(outputStream, obj);
return outputStream.ToArray();
}
public static object GetDeserializedObject(byte[] serializedObject)
{
MemoryStream inputStream = new MemoryStream(serializedObject);
BinaryFormatter bFormatter = new BinaryFormatter();
object obj = null;
obj = bFormatter.Deserialize(inputStream);
return obj;
}