[PR #69] [MERGED] Skip entry stream on dispose #821

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

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/69
Author: @pnewman8
Created: 7/15/2015
Status: Merged
Merged: 7/20/2015
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (2)

  • afff386 Skip entry stream on dispose
  • 8faebc7 Cancel moved from EntryStream to Reader

📊 Changes

5 files changed (+40 additions, -7 deletions)

View changed files

📝 SharpCompress/Archive/SevenZip/SevenZipArchive.cs (+1 -1)
📝 SharpCompress/Common/EntryStream.cs (+6 -4)
📝 SharpCompress/Reader/AbstractReader.cs (+29 -1)
📝 SharpCompress/Reader/IReader.cs (+3 -0)
📝 SharpCompress/Reader/Rar/RarReader.cs (+1 -1)

📄 Description

Until now the caller had to completely consume each entry stream, or call SkipEntry(), before disposing the stream. If not, exception was thrown: "EntryStream has not been fully consumed". Hugely inconvenient; a user-thrown exception inside a "using (EntryStream)" block would be discarded.

Now automatically skips the entry on dispose.

Added method EntryStream.Cancel(). Call this if entry stream is unfinished, and no further entries are required. Helps with efficiency, as it avoids reading data that is not needed.


🔄 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/69 **Author:** [@pnewman8](https://github.com/pnewman8) **Created:** 7/15/2015 **Status:** ✅ Merged **Merged:** 7/20/2015 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (2) - [`afff386`](https://github.com/adamhathcock/sharpcompress/commit/afff386622402efcd815184f46010e19502c82d8) Skip entry stream on dispose - [`8faebc7`](https://github.com/adamhathcock/sharpcompress/commit/8faebc78d0f22d2b63122dbfd6da698a628820b8) Cancel moved from EntryStream to Reader ### 📊 Changes **5 files changed** (+40 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `SharpCompress/Archive/SevenZip/SevenZipArchive.cs` (+1 -1) 📝 `SharpCompress/Common/EntryStream.cs` (+6 -4) 📝 `SharpCompress/Reader/AbstractReader.cs` (+29 -1) 📝 `SharpCompress/Reader/IReader.cs` (+3 -0) 📝 `SharpCompress/Reader/Rar/RarReader.cs` (+1 -1) </details> ### 📄 Description Until now the caller had to completely consume each entry stream, or call SkipEntry(), before disposing the stream. If not, exception was thrown: "EntryStream has not been fully consumed". Hugely inconvenient; a user-thrown exception inside a "using (EntryStream)" block would be discarded. Now automatically skips the entry on dispose. Added method EntryStream.Cancel(). Call this if entry stream is unfinished, and no further entries are required. Helps with efficiency, as it avoids reading data that is not needed. --- <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:17:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#821