mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
7zip streams always want to be disposed
This commit is contained in:
@@ -55,7 +55,7 @@ internal class SevenZipFilePart : FilePart
|
||||
{
|
||||
folderStream.Skip(skipSize);
|
||||
}
|
||||
return new ReadOnlySubStream(folderStream, Header.Size);
|
||||
return new ReadOnlySubStream(folderStream, Header.Size, leaveOpen: false);
|
||||
}
|
||||
|
||||
public CompressionType CompressionType
|
||||
|
||||
@@ -16,11 +16,11 @@ internal class ReadOnlySubStream : SharpCompressStream, IStreamStack
|
||||
|
||||
private long _position;
|
||||
|
||||
public ReadOnlySubStream(Stream stream, long bytesToRead)
|
||||
: this(stream, null, bytesToRead) { }
|
||||
public ReadOnlySubStream(Stream stream, long bytesToRead, bool leaveOpen = true)
|
||||
: this(stream, null, bytesToRead, leaveOpen) { }
|
||||
|
||||
public ReadOnlySubStream(Stream stream, long? origin, long bytesToRead)
|
||||
: base(stream, leaveOpen: true, throwOnDispose: false)
|
||||
public ReadOnlySubStream(Stream stream, long? origin, long bytesToRead, bool leaveOpen = true)
|
||||
: base(stream, leaveOpen, throwOnDispose: false)
|
||||
{
|
||||
if (origin != null && stream.Position != origin.Value)
|
||||
{
|
||||
|
||||
@@ -138,8 +138,6 @@ public class SharpCompressStream : Stream, IStreamStack
|
||||
#endif
|
||||
}
|
||||
|
||||
internal bool IsRecording { get; private set; }
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
#if DEBUG_STREAMS
|
||||
|
||||
Reference in New Issue
Block a user