Fix decompression performance by delaying stream wrapping

Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-10-27 10:58:53 +00:00
parent f27ea2d5f6
commit 3cc4ccedfe

View File

@@ -20,8 +20,9 @@ public static class ArchiveFactory
public static IArchive Open(Stream stream, ReaderOptions? readerOptions = null)
{
readerOptions ??= new ReaderOptions();
var factory = FindFactory<IArchiveFactory>(stream);
stream = new SharpCompressStream(stream, bufferSize: readerOptions.BufferSize);
return FindFactory<IArchiveFactory>(stream).Open(stream, readerOptions);
return factory.Open(stream, readerOptions);
}
public static IWritableArchive Create(ArchiveType type)