Created
May 12, 2011 17:09
-
-
Save sclarson/968964 to your computer and use it in GitHub Desktop.
Generic Serializer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void SerializeObjectToFile<T>(string filename, T objectToSerialze) | |
{ | |
using (Stream stream = File.Open(filename, FileMode.Create)) | |
{ | |
var formatter = new BinaryFormatter(); | |
formatter.Serialize(stream, objectToSerialze); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment