PivotalTrackerAPI/Util/SerializationHelper.cs
/// <summary>
/// Serializes an object of type T to a binary file
/// </summary>
/// <typeparam name="T">The Type of object</typeparam>
/// <param name="t">The object to serialize</param>
/// <param name="inFilename">File to save</param>
Serializes an object of type T to a binary file
Serializes an object of type T to a binary file
public static void SerializeToBinaryFile<T>(T t, String inFilename)
    {
      Stream s = null;
      IFormatter f = new BinaryFormatter();
      try
      {
        s = new FileStream(inFilename, FileMode.Create);
        f.Serialize(s, t);
      }
      finally
      {
        if (s != null)
          s.Close();
      }
    }
public static void SerializeToBinaryFile < T > ( T t , String inFilename ) { Stream s = null ; IFormatter f = new BinaryFormatter ( ) ; try { s = new FileStream ( inFilename , FileMode . Create ) ; f . Serialize ( s , t ) ; } finally { if ( s != null ) s . Close ( ) ; } }
Serializes an object of type T to a binary file
Serializes an object of type T to a binary file
t
T
The object to serialize
The object to serialize
inFilename
String
File to save
File to save
typeparam
The Type of object
The Type of object