Implemented ReadByte/WriteByte on streams to improve performance

This commit is contained in:
Julien Lebosquain
2018-05-27 00:50:16 +02:00
parent 9e96dec8c9
commit 540618c062
17 changed files with 186 additions and 3 deletions

View File

@@ -51,6 +51,20 @@ namespace SharpCompress.IO
return read;
}
public override int ReadByte()
{
if (BytesLeftToRead <= 0)
{
return -1;
}
int value = Stream.ReadByte();
if (value != -1)
{
--BytesLeftToRead;
}
return value;
}
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();