[PR #212] Removed the unused code to write entries in Zip Headers #904

Open
opened 2026-01-29 22:18:08 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/212

State: closed
Merged: Yes


This is more a suggestion than a request.

As I found out with #210 there is some unused code.

The unused code appears because the writing of zip files is done from the Writers.Zip namespace, and the reading is done in Common.Zip.Headers.

I guess there could be a consolidation of the two, such that the same classes represents the same entries for both readers and writers. If this is a better approach, much of the code in ZipWriter.cs can be moved into the Common.Zip.Headers classes, but there are edge cases, as the writers need to store some temporary information in the structures (can be solved by a writer-specific class deriving from the other entry perhaps).

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/212 **State:** closed **Merged:** Yes --- This is more a suggestion than a request. As I found out with #210 there is some unused code. The unused code appears because the writing of zip files is done from the `Writers.Zip` namespace, and the reading is done in `Common.Zip.Headers`. I guess there could be a consolidation of the two, such that the same classes represents the same entries for both readers and writers. If this is a better approach, much of the code in `ZipWriter.cs` can be moved into the `Common.Zip.Headers` classes, but there are edge cases, as the writers need to store some temporary information in the structures (can be solved by a writer-specific class deriving from the other entry perhaps).
claunia added the pull-request label 2026-01-29 22:18:08 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#904