icsharpcode / SharpZipLib

#ziplib is a Zip, GZip, Tar and BZip2 library written entirely in C# for the .NET platform.

Home Page:http://icsharpcode.github.io/SharpZipLib/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stream returned by ZipFile.GetInputStream() hangs when accessing Length property

Sardelka9515 opened this issue · comments

Steps to reproduce

  1. Create a new ZipFile instance
  2. Get a Stream object returned by ZipFile.GetInputStream(), and try to get it's length.
  3. Program stuck

Expected behavior

Return the acutal length of the decompressed file. Or throw an expection if it's not possibile.

Actual behavior

When accesing Stream.Length propperty from the object returned by ZipFile.GetInputStream(), execution hangs.

Version of SharpZipLib

Obtained from (only keep the relevant lines)

  • Package installed using NuGet
    1.3.3

It should throw, not sure what is happening in your case:

/// <summary>
/// A value representing the length of the stream in bytes.
/// </summary>
public override long Length
{
get
{
//return inputBuffer.RawLength;
throw new NotSupportedException("InflaterInputStream Length is not supported");
}
}

Ah, my bad. Exception not caught correctly, nevermind