[PR #205] [MERGED] Add zip64 support for ZipArchive extraction #891

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/205
Author: @markryd
Created: 1/24/2017
Status: Merged
Merged: 1/24/2017
Merged by: @adamhathcock

Base: masterHead: zip64-extraction


📝 Commits (1)

  • 6be6ef0 Add zip64 support for ZipArchive extraction

📊 Changes

10 files changed (+177 additions, -41 deletions)

View changed files

📝 src/SharpCompress/Common/Zip/Headers/DirectoryEndHeader.cs (+10 -0)
src/SharpCompress/Common/Zip/Headers/Zip64DirectoryEndHeader.cs (+54 -0)
src/SharpCompress/Common/Zip/Headers/Zip64DirectoryEndLocatorHeader.cs (+30 -0)
📝 src/SharpCompress/Common/Zip/Headers/ZipFileEntry.cs (+4 -2)
📝 src/SharpCompress/Common/Zip/Headers/ZipHeaderType.cs (+3 -1)
📝 src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs (+50 -27)
📝 src/SharpCompress/Common/Zip/ZipFilePart.cs (+2 -1)
📝 src/SharpCompress/Common/Zip/ZipHeaderFactory.cs (+12 -9)
📝 test/SharpCompress.Test/Zip/ZipArchiveTests.cs (+12 -1)
test/TestArchives/Archives/Zip.zip64.zip (+0 -0)

📄 Description

I've taken a first cut at some limited zip64 support. It is extract only and only on the Archive API at this point.

Note: I'm casting 8 byte values to long instead of supporting the full ulong as it simplifies the implementation quite a bit. Things like Reader.Seek take a long directly, it's easy enough to cover that with multiple reads but I ended up backing away as it made the change much larger for minimal benefit (9 Exabyte archive size limitation instead of 18 etc). Also CLS compliance means we can't expose ulong. More than happy to revisit that if required.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/205 **Author:** [@markryd](https://github.com/markryd) **Created:** 1/24/2017 **Status:** ✅ Merged **Merged:** 1/24/2017 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `zip64-extraction` --- ### 📝 Commits (1) - [`6be6ef0`](https://github.com/adamhathcock/sharpcompress/commit/6be6ef0b5c3ed6a4d40d00c8fb133518e75e4a6f) Add zip64 support for ZipArchive extraction ### 📊 Changes **10 files changed** (+177 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Common/Zip/Headers/DirectoryEndHeader.cs` (+10 -0) ➕ `src/SharpCompress/Common/Zip/Headers/Zip64DirectoryEndHeader.cs` (+54 -0) ➕ `src/SharpCompress/Common/Zip/Headers/Zip64DirectoryEndLocatorHeader.cs` (+30 -0) 📝 `src/SharpCompress/Common/Zip/Headers/ZipFileEntry.cs` (+4 -2) 📝 `src/SharpCompress/Common/Zip/Headers/ZipHeaderType.cs` (+3 -1) 📝 `src/SharpCompress/Common/Zip/SeekableZipHeaderFactory.cs` (+50 -27) 📝 `src/SharpCompress/Common/Zip/ZipFilePart.cs` (+2 -1) 📝 `src/SharpCompress/Common/Zip/ZipHeaderFactory.cs` (+12 -9) 📝 `test/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+12 -1) ➕ `test/TestArchives/Archives/Zip.zip64.zip` (+0 -0) </details> ### 📄 Description I've taken a first cut at some limited zip64 support. It is extract only and only on the Archive API at this point. Note: I'm casting 8 byte values to `long` instead of supporting the full `ulong` as it simplifies the implementation quite a bit. Things like `Reader.Seek` take a `long` directly, it's easy enough to cover that with multiple reads but I ended up backing away as it made the change much larger for minimal benefit (9 Exabyte archive size limitation instead of 18 etc). Also CLS compliance means we can't expose `ulong`. More than happy to revisit that if required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:18:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#891