mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 23:45:14 +00:00
Rejigger read only substream
This commit is contained in:
@@ -21,7 +21,7 @@ namespace SharpCompress.IO
|
||||
}
|
||||
}
|
||||
|
||||
public Stream Stream { get; }
|
||||
protected Stream Stream { get; }
|
||||
|
||||
public override bool CanRead => Stream.CanRead;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.IO;
|
||||
|
||||
namespace SharpCompress.IO
|
||||
{
|
||||
internal class ReadOnlySubStream : Stream
|
||||
internal class ReadOnlySubStream : NonDisposingStream
|
||||
{
|
||||
public ReadOnlySubStream(Stream stream, long bytesToRead)
|
||||
: this(stream, null, bytesToRead)
|
||||
@@ -11,8 +11,8 @@ namespace SharpCompress.IO
|
||||
}
|
||||
|
||||
public ReadOnlySubStream(Stream stream, long? origin, long bytesToRead)
|
||||
: base(stream, false)
|
||||
{
|
||||
Stream = stream;
|
||||
if (origin != null)
|
||||
{
|
||||
stream.Position = origin.Value;
|
||||
@@ -20,18 +20,8 @@ namespace SharpCompress.IO
|
||||
BytesLeftToRead = bytesToRead;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
//Stream.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private long BytesLeftToRead { get; set; }
|
||||
|
||||
public Stream Stream { get; }
|
||||
|
||||
public override bool CanRead => true;
|
||||
|
||||
public override bool CanSeek => false;
|
||||
|
||||
Reference in New Issue
Block a user