Home
Manage Your Code
Snippet: Instance Serialization Helper Methods (C#)
Title: Instance Serialization Helper Methods Language: C#
Description: Two methods you can add to a class to Serialize to a binary stream and Deserialize back into an instance of the class Views: 468
Author: Dave Swersky Date Added: 2/26/2007
Copy Code  
1#region Serialization   ...        #endregion
Usage
Add these methods to your class for a handy binary serialization.  You can use them to save
a serialized instance to a file or a database BLOB field.
Notes
Replace the [TYPE] placeholders in the Deserialize method with the name of the class to which you add the methods. Note that the class must be marked Serializable.