Rejigger read only substream

This commit is contained in:
Adam Hathcock
2018-04-22 11:32:47 +01:00
parent 68a5e474a6
commit 89ae8ca526
2 changed files with 3 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ namespace SharpCompress.IO
}
}
public Stream Stream { get; }
protected Stream Stream { get; }
public override bool CanRead => Stream.CanRead;

View File

@@ -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;