The ZipStream Fix

May 25, 2010 at 7:05 PM
Edited May 26, 2010 at 10:34 AM

Noticed the "AvailableInBytes=0, etc" thing was fixed in 1.9, so downloaded it and put the dll in my project which has been throwing that exception left and right. However, It did not go away. What do I need to do to take advantage of the fix?


May 25, 2010 at 9:18 PM

I don't know, off the top of my head, what thing you are talking about. Is there a workitem you can reference?

Also, what version of the library are you using.


May 26, 2010 at 11:13 AM

thes verson as stated above is 1.9 (DotNetZip v1.9)

In the notable fixes section for this release on the download page is the following link:

Zlib exception when compressed stream size is (multiple of buffer size) + header size +(0 to 7)

I originally found out about the problem by finding the report the above link points to.

Have removed the old dll from my project, inserted the 1.9 dll as a reference and re compiled.

But still get the error.

May 26, 2010 at 11:48 AM

ok well if it's throwing exceptions left and right, send me a small snip of code that reproduces the problem.

May 26, 2010 at 12:08 PM

Using a database as the common point in a distributed set of applications. In the interests of speed and space am compressing what I store in the Sybase Image columns. So when another app needs to get it's work copy of the document it decompresses it. The following code is such a place:

byte[] html = Ionic.Zlib.GZipStream.UncompressBuffer((byte[])reader.GetValue(2));

The error I get is Ionic.Zlib.ZlibException: Protocol error. AvailableBytesIn=0, expected 8

The AvailableBytesIn value is always 0 never in the range 1-7 as reported in the Problem Report


May 26, 2010 at 6:30 PM

Seems I was trying to feed it a 0 byte array.

May 27, 2010 at 2:28 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.