mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-11-18 18:32:34 +00:00
even more
This commit is contained in:
@@ -31,11 +31,9 @@ public partial class ArcFilePart
|
||||
compressedStream = new RunLength90Stream(_stream, (int)Header.CompressedSize);
|
||||
break;
|
||||
case CompressionType.Squeezed:
|
||||
compressedStream = await SqueezeStream.CreateAsync(
|
||||
_stream,
|
||||
(int)Header.CompressedSize,
|
||||
cancellationToken
|
||||
);
|
||||
compressedStream = await SqueezeStream
|
||||
.CreateAsync(_stream, (int)Header.CompressedSize, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
break;
|
||||
case CompressionType.Crunched:
|
||||
if (Header.OriginalSize > 128 * 1024)
|
||||
|
||||
@@ -12,7 +12,7 @@ public partial class GZipEntry
|
||||
)
|
||||
{
|
||||
yield return new GZipEntry(
|
||||
await GZipFilePart.CreateAsync(stream, options.ArchiveEncoding),
|
||||
await GZipFilePart.CreateAsync(stream, options.ArchiveEncoding).ConfigureAwait(false),
|
||||
options
|
||||
);
|
||||
}
|
||||
|
||||
@@ -76,12 +76,9 @@ public static partial class ADCBase
|
||||
break;
|
||||
}
|
||||
|
||||
var readCount = await input.ReadAsync(
|
||||
buffer,
|
||||
outPosition,
|
||||
chunkSize,
|
||||
cancellationToken
|
||||
);
|
||||
var readCount = await input
|
||||
.ReadAsync(buffer, outPosition, chunkSize, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
outPosition += readCount;
|
||||
position += readCount + 1;
|
||||
break;
|
||||
|
||||
@@ -66,10 +66,9 @@ public sealed partial class ADCStream
|
||||
|
||||
if (_outBuffer is null)
|
||||
{
|
||||
var result = await ADCBase.DecompressAsync(
|
||||
_stream,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var result = await ADCBase
|
||||
.DecompressAsync(_stream, cancellationToken: cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
_outBuffer = result.Output;
|
||||
_outPosition = 0;
|
||||
}
|
||||
@@ -87,10 +86,9 @@ public sealed partial class ADCStream
|
||||
copied += piece;
|
||||
_position += piece;
|
||||
toCopy -= piece;
|
||||
var result = await ADCBase.DecompressAsync(
|
||||
_stream,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
var result = await ADCBase
|
||||
.DecompressAsync(_stream, cancellationToken: cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
_outBuffer = result.Output;
|
||||
_outPosition = 0;
|
||||
if (result.BytesRead == 0 || _outBuffer is null || _outBuffer.Length == 0)
|
||||
|
||||
@@ -31,12 +31,9 @@ public sealed partial class BZip2Stream
|
||||
}
|
||||
else
|
||||
{
|
||||
bZip2Stream.stream = await CBZip2InputStream.CreateAsync(
|
||||
stream,
|
||||
decompressConcatenated,
|
||||
leaveOpen,
|
||||
cancellationToken
|
||||
);
|
||||
bZip2Stream.stream = await CBZip2InputStream
|
||||
.CreateAsync(stream, decompressConcatenated, leaveOpen, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return bZip2Stream;
|
||||
|
||||
@@ -60,12 +60,14 @@ internal static partial class DecoderRegistry
|
||||
case K_RISCV:
|
||||
return new BCJFilterRISCV(false, inStreams.Single());
|
||||
case K_B_ZIP2:
|
||||
return await BZip2Stream.CreateAsync(
|
||||
inStreams.Single(),
|
||||
CompressionMode.Decompress,
|
||||
true,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
return await BZip2Stream
|
||||
.CreateAsync(
|
||||
inStreams.Single(),
|
||||
CompressionMode.Decompress,
|
||||
true,
|
||||
cancellationToken: cancellationToken
|
||||
)
|
||||
.ConfigureAwait(false);
|
||||
case K_PPMD:
|
||||
return await PpmdStream
|
||||
.CreateAsync(
|
||||
|
||||
@@ -54,7 +54,9 @@ public class TarWrapper(
|
||||
BZip2Stream.IsBZip2Async,
|
||||
(stream) => BZip2Stream.Create(stream, CompressionMode.Decompress, false),
|
||||
async (stream, _) =>
|
||||
await BZip2Stream.CreateAsync(stream, CompressionMode.Decompress, false),
|
||||
await BZip2Stream
|
||||
.CreateAsync(stream, CompressionMode.Decompress, false)
|
||||
.ConfigureAwait(false),
|
||||
["tar.bz2", "tb2", "tbz", "tbz2", "tz2"]
|
||||
),
|
||||
new(
|
||||
|
||||
@@ -32,9 +32,9 @@ public abstract partial class RarReader
|
||||
throw new InvalidOperationException("no stream for redirect entry");
|
||||
}
|
||||
|
||||
var stream = await MultiVolumeReadOnlyAsyncStream.Create(
|
||||
CreateFilePartEnumerableForCurrentEntryAsync().CastAsync<RarFilePart>()
|
||||
);
|
||||
var stream = await MultiVolumeReadOnlyAsyncStream
|
||||
.Create(CreateFilePartEnumerableForCurrentEntryAsync().CastAsync<RarFilePart>())
|
||||
.ConfigureAwait(false);
|
||||
if (Entry.IsRarV3)
|
||||
{
|
||||
return CreateEntryStream(
|
||||
|
||||
Reference in New Issue
Block a user