title: DotNetZip chokes on a file
body: <p>Would anybody have an explanation as to why DotNetZip would spin its wheels on a file? I have this file, which is copyrighted and non-distributable, that will not be zipped. I can take an earlier version of the file, or a later one at that, and it will zip fine.</p>
  
  <p>The zip utility shouldn't care about a version, so I'm assuming it thinks the file is corrupt somehow. How can I debug this issue? When I step through the code, the issue does not occur, but if I just let it run, it stalls at the saving of this particular file. Here's the code from the library:</p>
  
  <pre><code>ICollection&lt;ZipEntry&gt; c = (SortEntriesBeforeSaving) ? EntriesSorted : Entries;
  foreach (ZipEntry e in c) // _entries.Values
  {
      OnSaveEntry(n, e, true);
      e.Write(WriteStream);
      if (_saveOperationCanceled)
          break;
  
      n++;
      OnSaveEntry(n, e, false);
      if (_saveOperationCanceled)
          break;
  
      // Some entries can be skipped during the save.
      if (e.IncludedInMostRecentSave)
          thisSaveUsedZip64 |= e.OutputUsedZip64.Value;
  }
  </code></pre>
  
  <p>If I put a breakpoint in that loop and let it save each file individually, then it does not choke when it sees the "bad file".</p>
  
  <p>Any thoughts? I would greatly appreciate it!</p>
  
  <p>EDIT 1:</p>
  
  <p>Just to be clear, when I say "choke" I mean that it goes into some kind of infinite loop and will not proceed with zipping the "bad file" and moving onto the rest. Also, this is a file that is getting used by a lot of people, so it shouldn't be corrupt.</p>
  
  <p>EDIT 2:</p>
  
  <p>I've narrowed it down to the following:</p>
  
  <pre><code>zip.CompressionMethod = CompressionMethod.Deflate;
  </code></pre>
  
  <p>That compression mode causes the issue. I'm pretty sure this is a bug of some kind. The other compression method, Bzip2, is super slow. I'm not sure how I am going to get around this yet.</p>
  
  <p>EDIT 3:</p>
  
  <p>DotNetZip is very strange indeed. I had it fixed by adjusting the compression level to this:</p>
  
  <pre><code>zip.CompressionLevel = CompressionLevel.Default;
  </code></pre>
  
  <p>This fixed the problem, but then I came back after a few minutes and it would work no longer. Bzip2 still works, but like I said before, it is incredibly slow. So, I began messing around with other pieces of the ZipFile API, and I added this:</p>
  
  <pre><code>zip.CodecBufferSize = 10240000;
  </code></pre>
  
  <p>This makes it work now. I don't know what the bug is really?</p>