lzma works with zip

This commit is contained in:
Adam Hathcock
2026-01-30 12:28:01 +00:00
parent 595a97bd62
commit 6c3f7c86da
2 changed files with 17 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ internal abstract partial class ZipFilePart
await stream
.ReadFullyAsync(props, 0, propsSize, cancellationToken)
.ConfigureAwait(false);
return LzmaStream.Create(
return await LzmaStream.CreateAsync(
props,
stream,
Header.CompressedSize > 0 ? Header.CompressedSize - 4 - props.Length : -1,

View File

@@ -8,6 +8,22 @@ namespace SharpCompress.Compressors.LZMA;
public partial class LzmaStream
{
public static ValueTask<LzmaStream> CreateAsync(
byte[] properties,
Stream inputStream,
long inputSize,
long outputSize,
bool leaveOpen = false
) =>
CreateAsync(
properties,
inputStream,
inputSize,
outputSize,
null,
properties.Length < 5,
leaveOpen
);
public static async ValueTask<LzmaStream> CreateAsync(
byte[] properties,
Stream inputStream,