Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add managed Deflate64 support to ZipArchive #11264

Merged
merged 4 commits into from
Sep 1, 2016
Merged

Add managed Deflate64 support to ZipArchive #11264

merged 4 commits into from
Sep 1, 2016

Conversation

ianhays
Copy link
Contributor

@ianhays ianhays commented Aug 30, 2016

This PR adds back the old managed Deflate implementation and makes it compatible with the Deflate64 algorithm. ZipArchive is modified to use this managed Deflate64 stream whenever it detects an entry compressed using it. This doesn't add any compression support, only decompression, and an archive entry opened in Update mode will be written back using Deflate, not Deflate64.

This resolves the errors we've been seeing lately around windows zips >2gb throwing exceptions. resolves
https://github.com/dotnet/corefx/issues/9925. Progress towards https://github.com/dotnet/corefx/issues/6602.

Tests coming in another PR where I'll also update the TestData version. I'll be waiting to merge this PR until that one is complete, but this one is big enough already.

@stephentoub

_buffer = new byte[DefaultBufferSize];
}

private static IDeflater CreateDeflater(CompressionLevel? compressionLevel)
/// <summary>
/// Sets up this DeflateManagedStream to be used for Zlib Deflation/Compression
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is counter-intuitive... the managed implementation is using zlib?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built this DeflateStream off of the existing one so they'd be minimally different if we decided to merge them later. I remove this comment in a later commit.

@stephentoub
Copy link
Member

A few questions/comments, otherwise LGTM, assuming the new tests you added pass.

dotnet-bot and others added 4 commits September 1, 2016 08:50
- Rename managed deflater to DeflateManagedStream, make internal
- Bring over some improvements from the internal DeflateStream to the DeflateManagedStream
- Remove the files that aren't getting used anymore
- Move native deflate files to their own folder to make the separation clearer
- Update the .NET license headers in the managed deflate files
Modifies our Managed Deflate implementation to accept Deflate64 streams when an internal bool is set. When ZipArchive finds a deflate64 entry, it will create a new DeflateManagedStream instead of a DeflateStream.
@ianhays ianhays merged commit 6e7e7eb into dotnet:master Sep 1, 2016
@karelz karelz modified the milestones: 1.1.0, 1.0.x Dec 3, 2016
@ianhays ianhays deleted the compression_deflate64_2 branch April 25, 2017 18:03
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…te64_2

Add managed Deflate64 support to ZipArchive

Commit migrated from dotnet/corefx@6e7e7eb
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants