Skip to content

ZipFile(Stream) constructor closes the stream before user can set IsStreamOwner #144

@jaymrobinson

Description

@jaymrobinson

Steps to reproduce

  1. Pass a stream containing a .pdf file to the ZipFile(Stream) constructor
  2. Catch exception (ZipException: Cannot find central directory)
  3. Attempt to access the stream again

Expected behavior

The constructor shouldn't automatically close the stream on an exception.
At least, there should be an optional constructor parameter to specify IsStreamOwner.

Actual behavior

The constructor closes the stream, so we can't do anything with it after the constructor fails.

Version of SharpZipLib

0.86.0.518

Obtained from (place an x between the brackets for all that apply)

  • Compiled from source
    • branch: _______
    • commit: _______
  • Downloaded DLL from GitHub
  • Downloaded DLL from SourceForge
  • Downloaded DLL from _______
  • DLL included as part of
  • Package installed using:
    • [ x] NuGet
    • MyGet
    • Chocolatey

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions