mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #1038] Add SOZip (Seek-Optimized ZIP) support #1461
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1038
Author: @Copilot
Created: 11/26/2025
Status: 🔄 Open
Base:
master← Head:copilot/add-so-optimized-zip-support📝 Commits (10+)
0ac6b46Initial planac4bcd0Add SOZip index data structure and basic testsa350899Add SOZip detection in ZipEntry and additional testsd9c9612Update documentation for SOZip support8c6d914reader tests don't pass or make sense7339567Fix SOZip tests to work correctly with ZipReader and ZipArchive9058645sozip writing and validation0dc6322Merge master branch and resolve FORMATS.md conflict130e169Merge remote-tracking branch 'origin/master' into copilot/add-so-optimized-zip-supportb3ce90aRemove foo.zip and add Zip.sozip.zip test archive with tests📊 Changes
13 files changed (+1354 additions, -7 deletions)
View changed files
📝
FORMATS.md(+1 -1)📝
src/SharpCompress/Common/Zip/Headers/LocalEntryHeaderExtraFactory.cs(+43 -0)➕
src/SharpCompress/Common/Zip/SOZip/SOZipDeflateStream.cs(+150 -0)➕
src/SharpCompress/Common/Zip/SOZip/SOZipIndex.cs(+367 -0)📝
src/SharpCompress/Common/Zip/ZipEntry.cs(+22 -1)📝
src/SharpCompress/Writers/Zip/ZipCentralDirectoryEntry.cs(+1 -0)📝
src/SharpCompress/Writers/Zip/ZipWriter.cs(+104 -2)📝
src/SharpCompress/Writers/Zip/ZipWriterEntryOptions.cs(+7 -0)📝
src/SharpCompress/Writers/Zip/ZipWriterOptions.cs(+27 -0)📝
tests/SharpCompress.Test/TestBase.cs(+17 -3)➕
tests/SharpCompress.Test/Zip/SOZipReaderTests.cs(+257 -0)➕
tests/SharpCompress.Test/Zip/SoZipWriterTests.cs(+358 -0)➕
tests/TestArchives/Archives/Zip.sozip.zip(+0 -0)📄 Description
Adds support for SOZip (Seek-Optimized ZIP), a ZIP profile that enables random access within DEFLATE-compressed files by storing sync flush point offsets in hidden index files.
Changes Made
Core SOZip Implementation
SOZipIndexclass to read/write index files containing chunk offsets, sizes, and metadataSOZipExtraFieldclass to parse SOZip extra field (0x564B) linking entries to their index filesSOZipDeflateStreamfor Deflate compression that inserts sync flush points at chunk boundariesExtraDataTypeenumZipEntry Extensions
IsSozipproperty to detect entries with SOZip extra fieldIsSozipIndexFileproperty to identify hidden index files by name pattern (.filename.sozip.idx)Writer Options
EnableSOZip,SOZipChunkSize, andSOZipMinFileSizeconfiguration options onZipWriterOptionsEnableSOZipoverride onZipWriterEntryOptionsTest Archive and Tests
Zip.sozip.ziptest archive with proper SOZip structure (data file with index file containing chunk offsets)foo.ziptest archiveDocumentation
Testing
Notes
Reading and detection of SOZip archives is fully implemented. Writer configuration options are in place; full implementation of writing SOZip archives with sync flush compression is available for testing.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.