mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-11 03:27:11 +00:00
fmt
This commit is contained in:
@@ -466,8 +466,9 @@ public class LzmaStream : Stream, IStreamStack
|
||||
if (control >= 0xC0)
|
||||
{
|
||||
_needProps = false;
|
||||
await this.ReadExactlyAsync(controlBuffer, 0, 1, cancellationToken).ConfigureAwait(false);
|
||||
Properties[0] = controlBuffer[0];
|
||||
await this.ReadExactlyAsync(controlBuffer, 0, 1, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
Properties[0] = controlBuffer[0];
|
||||
_inputPosition++;
|
||||
|
||||
_decoder = new Decoder();
|
||||
|
||||
@@ -44,19 +44,20 @@ internal static class StreamExtensions
|
||||
}
|
||||
}
|
||||
|
||||
internal static async Task ReadExactlyAsync(this Stream stream,
|
||||
byte[] buffer,
|
||||
int offset,
|
||||
int count,
|
||||
CancellationToken cancellationToken
|
||||
internal static async Task ReadExactlyAsync(
|
||||
this Stream stream,
|
||||
byte[] buffer,
|
||||
int offset,
|
||||
int count,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
var totalRead = 0;
|
||||
while (totalRead < count)
|
||||
{
|
||||
var read = await stream
|
||||
.ReadAsync(buffer, offset + totalRead, count - totalRead, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
.ReadAsync(buffer, offset + totalRead, count - totalRead, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
if (read == 0)
|
||||
{
|
||||
throw new EndOfStreamException();
|
||||
|
||||
@@ -8,7 +8,7 @@ using Xunit;
|
||||
|
||||
namespace SharpCompress.Test;
|
||||
|
||||
public class ExtractAllTests: TestBase
|
||||
public class ExtractAllTests : TestBase
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Zip.deflate.zip")]
|
||||
|
||||
Reference in New Issue
Block a user