Changeset 402 for trunk/sources/HeuristicLab.Core
- Timestamp:
- 07/29/08 17:55:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/PersistenceManager.cs
r267 r402 25 25 using System.Xml; 26 26 using System.IO; 27 using System.IO.Compression; 27 28 28 29 namespace HeuristicLab.Core { … … 86 87 } 87 88 89 public static IStorable RestoreFromGZip(byte[] serializedStorable) { 90 GZipStream stream = new GZipStream(new MemoryStream(serializedStorable), CompressionMode.Decompress); 91 return Load(stream); 92 } 93 94 public static byte[] SaveToGZip(IStorable storable) { 95 MemoryStream memStream = new MemoryStream(); 96 GZipStream stream = new GZipStream(memStream, CompressionMode.Compress, true); 97 Save(storable, stream); 98 stream.Close(); 99 return memStream.ToArray(); 100 } 101 88 102 public static string BuildTypeString(Type type) { 89 103 string assembly = type.Assembly.FullName;
Note: See TracChangeset
for help on using the changeset viewer.