Posted By

dmilligan on 04/30/15


Tagged

file FileStream BinaryFormatter


Versions (?)

SaveBinaryData


 / Published in: C#
 

Generic binary data saver.

  1. public void SaveBinaryData<T>(string path, T data)
  2. {
  3. BinaryFormatter bf = new BinaryFormatter();
  4. using (FileStream fs = File.Create(path))
  5. {
  6. bf.Serialize(fs, data);
  7. fs.Close();
  8. }
  9. }

Report this snippet  

You need to login to post a comment.