mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-23 15:34:34 +00:00
Update src/SharpCompress/IO/ReadOnlySubStream.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -124,12 +124,9 @@ internal class ReadOnlySubStream : SharpCompressStream, IStreamStack
|
||||
)
|
||||
{
|
||||
var sliceLen = BytesLeftToRead < buffer.Length ? BytesLeftToRead : buffer.Length;
|
||||
var mem = buffer;
|
||||
if (sliceLen != buffer.Length)
|
||||
{
|
||||
mem = buffer.Slice(0, (int)sliceLen);
|
||||
}
|
||||
var read = await Stream.ReadAsync(mem, cancellationToken).ConfigureAwait(false);
|
||||
var read = await Stream
|
||||
.ReadAsync(buffer.Slice(0, (int)sliceLen), cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
if (read > 0)
|
||||
{
|
||||
BytesLeftToRead -= read;
|
||||
|
||||
Reference in New Issue
Block a user