Beispiel #1
0
 public static void SerializeToZip(SerializableTrigramStatistics stats, string filePath)
 {
     using (var fileStream = File.Create(filePath))
         using (var zipStream = new GZipStream(fileStream, CompressionLevel.Optimal))
         {
             Serialize(stats, zipStream);
         }
 }
Beispiel #2
0
        public static void Serialize(SerializableTrigramStatistics stats, Stream output)
        {
            var serializer = new DataContractJsonSerializer(typeof(SerializableTrigramStatistics));

            serializer.WriteObject(output, stats);
        }