title: How to write a JSON ZIP?
body: <p>I serialize objects into JSON. On the fly I want to compress it in ZIP. ZIP file is created, but it turns out the damaged and empty. If you can tell, I'll be very grateful.</p>
  
  <pre><code>public void Write(List&lt;Dictionary&lt;string,string&gt;&gt; data)
  {
      if (data.Count == 0) // If the collection is empty, then return
          return;
      PartNumber++; // In the archive are added many files. This is part of a single file
      string FullFileName = FolderWrite + FileName + ".zip";
      fsWrite = new FileStream(FullFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);
      ZipArchive archive = new  ZipArchive(fsWrite, ZipArchiveMode.Update);
      ZipArchiveEntry entry = archive.CreateEntry(FileName + ".part_" + PartNumber.ToString(), CompressionLevel.Optimal);
      Stream s = entry.Open();
      DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(List&lt;Dictionary&lt;string,string&gt;&gt;));
      ser.WriteObject(s, data);
      s.Close();
      fsWrite.Close();
  }
  </code></pre>