mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-06 05:27:05 +00:00
Wrapped Streams are always disposed - 0.21 #300
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?
Originally created by @t246246 on GitHub (May 16, 2018).
This program
worked in version 0.20.0 (as long as the 3rd argument of BZip2Stream is true.)
It was the only way I managed to find getting bzip'ed bytes in memory.
It no longer works current 0.21.1 --- memoryStream is closed when trying to get Length. So how to get bzip'ed imege to memory stream (without using temporary file?)
@adamhathcock commented on GitHub (May 16, 2018):
Don't allow the stream to be disposed. Use
NonDisposingStreamlike:@adamhathcock commented on GitHub (May 16, 2018):
FYI, there was a breaking change in behavior in regards to how stream disposal is handled. I used to fight the good fight and try to make it so that Streams wouldn't dispose/close wrapped Streams they didn't own. However, this is rarely the case for many reasons. Now, you should assume disposing a Stream/Reader will also dispose the wrapped Stream.
@adamhathcock commented on GitHub (May 16, 2018):
Also updated USAGE: https://github.com/adamhathcock/sharpcompress/blob/master/USAGE.md