[PR #354] [MERGED] Support Deflate64 decompression #983

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/354
Author: @frabar666
Created: 2/28/2018
Status: Merged
Merged: 3/1/2018
Merged by: @adamhathcock

Base: masterHead: deflate64-decompress


📝 Commits (1)

  • 6e2c7d2 support Deflate64 decompression

📊 Changes

19 files changed (+2062 additions, -3 deletions)

View changed files

📝 FORMATS.md (+3 -2)
📝 src/SharpCompress/Common/CompressionType.cs (+2 -1)
📝 src/SharpCompress/Common/Zip/ZipEntry.cs (+4 -0)
📝 src/SharpCompress/Common/Zip/ZipFilePart.cs (+5 -0)
src/SharpCompress/Compressors/Deflate64/BlockType.cs (+13 -0)
src/SharpCompress/Compressors/Deflate64/Deflate64Stream.cs (+257 -0)
src/SharpCompress/Compressors/Deflate64/DeflateInput.cs (+43 -0)
src/SharpCompress/Compressors/Deflate64/FastEncoderStatus.cs (+245 -0)
src/SharpCompress/Compressors/Deflate64/HuffmanTree.cs (+311 -0)
src/SharpCompress/Compressors/Deflate64/InflaterManaged.cs (+738 -0)
src/SharpCompress/Compressors/Deflate64/InflaterState.cs (+42 -0)
src/SharpCompress/Compressors/Deflate64/InputBuffer.cs (+202 -0)
src/SharpCompress/Compressors/Deflate64/Match.cs (+17 -0)
src/SharpCompress/Compressors/Deflate64/MatchState.cs (+13 -0)
src/SharpCompress/Compressors/Deflate64/OutputWindow.cs (+151 -0)
📝 tests/SharpCompress.Test/TestBase.cs (+1 -0)
📝 tests/SharpCompress.Test/Zip/ZipArchiveTests.cs (+10 -0)
📝 tests/SharpCompress.Test/Zip/ZipReaderTests.cs (+5 -0)
tests/TestArchives/Archives/Zip.deflate64.zip (+0 -0)

📄 Description

This adds support for the Deflate64 decompression algorithm, and its use in ZIP archives. Compression is not implemented.

Deflate64 (method 9 in ZIP archives) is a variation of the standard Deflate algorithm.
In Windows Explorer, compressing >2GB files generates a Deflate64-compressed ZIP file.
7-zip can read and write Deflate64 ZIP files.

Entry point is SharpCompress.Compressors.Deflate64.Deflate64Stream, with the same interface as the existing DeflateStream (except only decompression is supported).

Implementation is copied from CoreFX, which is MIT-licensed too. Unfortunately it has to be copied, because it is 1. internal, and 2. not supported on all targeted platforms.
Differences between Deflate and Deflate64 are minor, so I first tried to add Deflate64 support in the existing DeflateStream... but I failed, hence this distinct implementation.


🔄 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/354 **Author:** [@frabar666](https://github.com/frabar666) **Created:** 2/28/2018 **Status:** ✅ Merged **Merged:** 3/1/2018 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `deflate64-decompress` --- ### 📝 Commits (1) - [`6e2c7d2`](https://github.com/adamhathcock/sharpcompress/commit/6e2c7d28573549d243b860625bf1c2665c080f0b) support Deflate64 decompression ### 📊 Changes **19 files changed** (+2062 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `FORMATS.md` (+3 -2) 📝 `src/SharpCompress/Common/CompressionType.cs` (+2 -1) 📝 `src/SharpCompress/Common/Zip/ZipEntry.cs` (+4 -0) 📝 `src/SharpCompress/Common/Zip/ZipFilePart.cs` (+5 -0) ➕ `src/SharpCompress/Compressors/Deflate64/BlockType.cs` (+13 -0) ➕ `src/SharpCompress/Compressors/Deflate64/Deflate64Stream.cs` (+257 -0) ➕ `src/SharpCompress/Compressors/Deflate64/DeflateInput.cs` (+43 -0) ➕ `src/SharpCompress/Compressors/Deflate64/FastEncoderStatus.cs` (+245 -0) ➕ `src/SharpCompress/Compressors/Deflate64/HuffmanTree.cs` (+311 -0) ➕ `src/SharpCompress/Compressors/Deflate64/InflaterManaged.cs` (+738 -0) ➕ `src/SharpCompress/Compressors/Deflate64/InflaterState.cs` (+42 -0) ➕ `src/SharpCompress/Compressors/Deflate64/InputBuffer.cs` (+202 -0) ➕ `src/SharpCompress/Compressors/Deflate64/Match.cs` (+17 -0) ➕ `src/SharpCompress/Compressors/Deflate64/MatchState.cs` (+13 -0) ➕ `src/SharpCompress/Compressors/Deflate64/OutputWindow.cs` (+151 -0) 📝 `tests/SharpCompress.Test/TestBase.cs` (+1 -0) 📝 `tests/SharpCompress.Test/Zip/ZipArchiveTests.cs` (+10 -0) 📝 `tests/SharpCompress.Test/Zip/ZipReaderTests.cs` (+5 -0) ➕ `tests/TestArchives/Archives/Zip.deflate64.zip` (+0 -0) </details> ### 📄 Description This adds support for the Deflate64 decompression algorithm, and its use in ZIP archives. Compression is not implemented. Deflate64 (method 9 in ZIP archives) is a variation of the standard Deflate algorithm. In Windows Explorer, compressing >2GB files generates a Deflate64-compressed ZIP file. 7-zip can read and write Deflate64 ZIP files. Entry point is `SharpCompress.Compressors.Deflate64.Deflate64Stream`, with the same interface as the existing `DeflateStream` (except only decompression is supported). Implementation is copied from CoreFX, which is MIT-licensed too. Unfortunately it has to be copied, because it is 1. internal, and 2. not supported on all targeted platforms. Differences between Deflate and Deflate64 are minor, so I first tried to add Deflate64 support in the existing `DeflateStream`... but I failed, hence this distinct implementation. --- <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:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#983