Skip to content

Forward apis#126082

Draft
alinpahontu2912 wants to merge 10 commits intodotnet:mainfrom
alinpahontu2912:forward_apis
Draft

Forward apis#126082
alinpahontu2912 wants to merge 10 commits intodotnet:mainfrom
alinpahontu2912:forward_apis

Conversation

@alinpahontu2912
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ZipStreamReader and ZipForwardReadEntry for 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Copilot AI review requested due to automatic review settings March 31, 2026 12:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 9 comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Forward-only API for System.IO.Compression

4 participants