title: ZipOutputStream generates corrupted zip file when zipenty is numerous
body: <p>
  I have the code below to simulate an action i am trying to perform using SharpZipLib. The generated zip file runs well when the limit of 'i' is low. But as 'i' tends towards a high value e.g 100, the generated zip file is corrupted. When I repair it, it opens okay. Is there any mistake i am making. Thanks.
  </p>      
  
  <pre><code>using(MemoryStream memoryStream = new MemoryStream())
  using (ZipOutputStream zipOutputStream = new ZipOutputStream(memoryStream))
  {
      zipOutputStream.SetLevel(3);
      for (int i = 1; i &lt; 10; i++)
      {
          ZipEntry zipEntry = new ZipEntry("Test" + i.ToString() + ".xlsx");
          zipEntry.DateTime = DateTime.Now;
          zipOutputStream.PutNextEntry(zipEntry);
          using (Stream inputStream = File.OpenRead(@templatePath))
          {
              StreamUtils.Copy(inputStream, zipOutputStream, 
                new byte[inputStream.Length]);
              inputStream.Close();
  
              zipOutputStream.CloseEntry();
          }
      }
  
      zipOutputStream.IsStreamOwner = false;
      zipOutputStream.Close();
  
      memoryStream.Position = 0;
      WorkbookUtil.StreamFileToBrowser("Report.Zip", memoryStream.GetBuffer());
  }
  </code></pre>
  
  <p>WorkbookUtil.StreamFileToBrowser is my static method to download files to the user browser</p>
  
  <h2>Update:</h2>
  
  <p>This is the Method for downloading to Browser</p>
  
  <pre><code>public static void StreamFileToBrowser(string sFileName, byte[] fileBytes)
          {
              System.Web.HttpContext context = System.Web.HttpContext.Current;
              context.Response.Clear();
              context.Response.ClearHeaders();
              context.Response.ClearContent();
              context.Response.AppendHeader("content-length", fileBytes.Length.ToString());
              context.Response.ContentType = GetMimeTypeByFileName("application/zip");
              context.Response.AppendHeader("content-disposition", "attachment; filename=" + sFileName);
              context.Response.BinaryWrite(fileBytes);
  
              context.ApplicationInstance.CompleteRequest();
          }
  </code></pre>