0

I'm working with DotNetZip, a zipfile class library. I noticed that the Inflate method takes a FlushType parameter "flush", yet this method doesn't use it at all. The only reference to this parameter is commented out.

Is there any reason for flush to be passed in?

Why is there commented-out code referencing it?

Is there a use case for commenting it back in?

Note there is also a reference in the source to a "workitem 8870" but I have no idea what that is a reference to.

Source: https://github.com/jstedfast/Ionic.Zlib/blob/master/Ionic.Zlib/Inflate.cs

I came across this while working to solve a Inflate Exception "unknown compression method" when closing a stream which happens to pass "FlushType.Finish" into Inflate. This is happening on iOS but not Android for some reason, so my investigation has lead me to this question. What's odd is that there was no Exception when Inflating the bytes when reading, only when closing the stream. If anyone has any insight on this please let me know.

Thanks

 internal int Inflate(FlushType flush)
        {
            int b;

            if (_codec.InputBuffer == null)
                throw new ZlibException("InputBuffer is null. ");

//             int f = (flush == FlushType.Finish)
//                 ? ZlibConstants.Z_BUF_ERROR
//                 : ZlibConstants.Z_OK;

            // workitem 8870
            int f = ZlibConstants.Z_OK;
            int r = ZlibConstants.Z_BUF_ERROR;
Druid
  • 1
  • 2

0 Answers0