Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a forward-only ZIP reading API to System.IO.Compression, enabling sequential entry access from non-seekable streams (network/pipes) without loading the full archive.
Changes:
- Introduces new public types
ZipStreamReaderandZipForwardReadEntryfor streaming ZIP entry enumeration and extraction. - Adds unit tests covering forward-only reading scenarios (known sizes, data descriptors, copy-data behavior, cancellation, etc.).
- Updates supporting infrastructure (custom streams, resources, ref surface, and project files) to wire in the new API.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs | Implements the forward-only ZIP reader and entry sequencing logic. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZipForwardReadEntry.cs | Defines the entry metadata + data stream + extraction helpers for the new reader. |
| src/libraries/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs | Adds bounded read stream for entry data and adjusts existing stream wrappers. |
| src/libraries/System.IO.Compression/src/Resources/Strings.resx | Adds new error strings for unsupported forward-only cases. |
| src/libraries/System.IO.Compression/ref/System.IO.Compression.cs | Exposes the new public API surface in the reference assembly. |
| src/libraries/System.IO.Compression/src/System.IO.Compression.csproj | Includes the new implementation source files. |
| src/libraries/System.IO.Compression/tests/ZipArchive/zip_StreamEntryReadTests.cs | Adds coverage for the new forward-only ZIP reader APIs. |
| src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj | Includes the new test file in the test project. |
| .gitignore | Adds *.md ignore pattern. |
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/tests/ZipArchive/zip_StreamEntryReadTests.cs
Outdated
Show resolved
Hide resolved
This was referenced Mar 25, 2026
Open
src/libraries/System.IO.Compression/tests/ZipArchive/zip_StreamEntryReadTests.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipForwardReadEntry.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Show resolved
Hide resolved
rzikm
reviewed
Mar 27, 2026
src/libraries/System.IO.Compression/tests/ZipArchive/zip_StreamEntryReadTests.cs
Outdated
Show resolved
Hide resolved
This was referenced Mar 27, 2026
This was referenced Mar 30, 2026
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipStreamReader.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipForwardReadEntry.cs
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipForwardReadEntry.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Compression/src/System/IO/Compression/ZipCustomStreams.cs
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1550
Follow TarReader implementation to create forward only apis for streaming Zip entries, without having to load the whole archive in memory. This enables reading Zip entries from network streams, pipes, and stdi