mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-11 13:35:00 +00:00
[PR #69] [MERGED] Skip entry stream on dispose #821
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/69
Author: @pnewman8
Created: 7/15/2015
Status: ✅ Merged
Merged: 7/20/2015
Merged by: @adamhathcock
Base:
master← Head:master📝 Commits (2)
afff386Skip entry stream on dispose8faebc7Cancel 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.