title: ZipArchive creates invalid ZIP file
body: <p>I am trying to create a new ZIP package from code with one entry and save the ZIP package to a file. I am trying to achive this with the <strong>System.IO.Compression.ZipArchive</strong> class. I am creating the ZIP package with the following code:</p>
  
  <pre><code>using (MemoryStream zipStream = new MemoryStream())
  {
      using (ZipArchive zip = new ZipArchive(zipStream, ZipArchiveMode.Create))
      {
          var entry = zip.CreateEntry("test.txt");
          using (StreamWriter sw = new StreamWriter(entry.Open()))
          {
              sw.WriteLine(
                  "Etiam eros nunc, hendrerit nec malesuada vitae, pretium at ligula.");
          }
  </code></pre>
  
  <p>Then I save the ZIP to a file either in WinRT:</p>
  
  <pre><code>        var file = await Windows.Storage.ApplicationData.Current.LocalFolder.CreateFileAsync("test.zip", CreationCollisionOption.ReplaceExisting);
          zipStream.Position = 0;
          using (Stream s = await file.OpenStreamForWriteAsync())
          {
              zipStream.CopyTo(s);
          }
  </code></pre>
  
  <p>Or in normal .NET 4.5:</p>
  
  <pre><code>        using (FileStream fs = new FileStream(@"C:\Temp\test.zip", FileMode.Create))
          {
              zipStream.Position = 0;
              zipStream.CopyTo(fs);
          }
  </code></pre>
  
  <p>However, I can't open the produced files neither in Windows Explorer, WinRAR, etc. (I checked that the size of the produced file matches the Length of the zipStream, so the stream itself was saved to the file correctly.)<br>
  Am I doing something wrong or is there a problem with the ZipArchive class?</p>