SetLevel in ZipFile

Open
#903 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
backend

Research direction

Start in src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs at ZipFile.GetOutputStream and inspect the hard-coded compression level of 9. Define the requested ZipFile compression-level API and verify that GetOutputStream uses the configured value when adding an entry to an existing archive.

Written by the indexing model from the issue text.

Description

enhancement zip
Is your feature request related to a problem? Please describe.

When I use ZipOutputStream, I can set compression level. When I want to add an entry to an existing zip archive I should use ZipFile and can't set compression level.

Describe the solution you'd like

I suggest to add CompressionLevel property or SetLevel() method to ZipFile and use it in the ZipFile.GetOutputStream instead of the hard coded 9:
https://github.com/icsharpcode/SharpZipLib/blob/ff2d7c30bdb2474d507f001bc555405e9f02a0bb/src/ICSharpCode.SharpZipLib/Zip/ZipFile.cs#L2754

Describe alternatives you've considered

Alternatively I want an ability to add an entry to an exitsing archive using ZipOutputStream

Tags

ZIP

Additional context

No response

Dominant language
C#
Stars
3.9k
Forks
1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from icsharpcode/SharpZipLib

All issues in icsharpcode/SharpZipLib

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.