Changeset 22 for trunk/sources
- Timestamp:
- 02/21/08 09:35:02 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/PersistenceManager.cs
r21 r22 62 62 } 63 63 public static void Save(IStorable instance, string filename) { 64 if (File.Exists(filename)) File.WriteAllText(filename, ""); 65 Save(instance, File.OpenWrite(filename)); 64 FileStream stream = File.Create(filename); 65 Save(instance, stream); 66 stream.Close(); 66 67 } 67 68 public static void Save(IStorable instance, Stream stream) { … … 71 72 } 72 73 public static IStorable Load(string filename) { 73 return Load(File.OpenRead(filename)); 74 FileStream stream = File.OpenRead(filename); 75 IStorable storable = Load(stream); 76 stream.Close(); 77 return storable; 74 78 } 75 79 public static IStorable Load(Stream stream) {
Note: See TracChangeset
for help on using the changeset viewer.