Skip to content

Document breaking change: PackagePart.GetStream() returns non-seekable stream for compressed parts in ReadWrite packages - #55225

Merged
gewarren merged 5 commits into
mainfrom
copilot/fix-packagepart-non-seekable-stream
Aug 5, 2026
Merged

Document breaking change: PackagePart.GetStream() returns non-seekable stream for compressed parts in ReadWrite packages#55225
gewarren merged 5 commits into
mainfrom
copilot/fix-packagepart-non-seekable-stream

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

System.IO.Packaging.PackagePart.GetStream() now returns a forward-only stream instead of a seekable MemoryStream when reading a compressed, unmodified part from a package opened with FileAccess.ReadWrite, following dotnet/runtime#129698. This change adds the corresponding breaking-change documentation.

New article

  • Added docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md covering:
    • Previous behavior (seekable MemoryStream) vs. new behavior (forward-only stream, CanSeek == false)
    • The five conditions required to observe the change, and scenarios that remain unaffected
    • Recommended action: manually copy to a MemoryStream when seekability is required, or use FileAccess.Read

Indexing

  • Added the article to docs/core/compatibility/toc.yml under Core .NET libraries for .NET 11
  • Added a row to the docs/core/compatibility/11.md breaking changes summary table

Example from the article

using Stream partStream = part.GetStream(FileMode.Open, FileAccess.Read);
using var seekable = new MemoryStream();
partStream.CopyTo(seekable);
seekable.Position = 0;
// Use 'seekable'. It's fully buffered and seekable.

Internal previews

File Preview link
docs/core/compatibility/11.md docs/core/compatibility/11
docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable
docs/core/compatibility/toc.yml docs/core/compatibility/toc

Copilot AI review requested due to automatic review settings August 4, 2026 15:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because there is no eligible user to bill. To allow Copilot reviews on bot-authored pull requests, enable direct organization billing in your organization's Copilot settings.

Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix PackagePart.GetStream() to return seekable stream for unmodified parts Document breaking change: PackagePart.GetStream() returns non-seekable stream for compressed parts in ReadWrite packages Aug 4, 2026
Copilot AI requested a review from gewarren August 4, 2026 15:50
Comment thread docs/core/compatibility/toc.yml Outdated
Comment thread docs/core/compatibility/toc.yml Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
@gewarren
gewarren marked this pull request as ready for review August 4, 2026 16:49
@gewarren
gewarren requested a review from a team as a code owner August 4, 2026 16:49
@gewarren
gewarren enabled auto-merge (squash) August 4, 2026 16:50
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
Comment thread docs/core/compatibility/toc.yml
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Comment thread docs/core/compatibility/core-libraries/11/packagepart-getstream-non-seekable.md Outdated
@gewarren
gewarren merged commit e7d4f32 into main Aug 5, 2026
12 checks passed
@gewarren
gewarren deleted the copilot/fix-packagepart-non-seekable-stream branch August 5, 2026 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Breaking change]: PackagePart.GetStream() returns a non-seekable stream for compressed parts in ReadWrite packages

5 participants