reading a single byte shouldn't be async

This commit is contained in:
Adam Hathcock
2025-12-19 13:05:04 +00:00
parent 93504cf82f
commit c790fd21a4

View File

@@ -448,9 +448,7 @@ public class LzmaStream : Stream, IStreamStack
private async Task DecodeChunkHeaderAsync(CancellationToken cancellationToken = default)
{
var controlBuffer = new byte[1];
await ReadFullyAsync(controlBuffer, 0, 1, cancellationToken).ConfigureAwait(false);
var control = controlBuffer[0];
var control = _inputStream.ReadByte();
_inputPosition++;
if (control == 0x00)
@@ -487,8 +485,7 @@ public class LzmaStream : Stream, IStreamStack
if (control >= 0xC0)
{
_needProps = false;
await ReadFullyAsync(controlBuffer, 0, 1, cancellationToken).ConfigureAwait(false);
Properties[0] = controlBuffer[0];
Properties[0] = (byte)_inputStream.ReadByte();
_inputPosition++;
_decoder = new Decoder();