SIL.FieldWorks.Common.Controls.Persistence.SerializeToBinary C# (CSharp) Method

SerializeToBinary() public static method

Serializes to binary an object.
public static SerializeToBinary ( object obj ) : MemoryStream
obj object The object to be serialized.
return System.IO.MemoryStream
		public static MemoryStream SerializeToBinary(object obj)
		{
			MemoryStream stream = new MemoryStream();
			//Construct a serialization formatter
			BinaryFormatter formatter = new BinaryFormatter();
			formatter.Serialize(stream, obj);
			return stream;
		}