mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-12 21:22:26 +00:00
[PR #1003] [MERGED] async lzma #1423
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/1003
Author: @adamhathcock
Created: 10/30/2025
Status: ✅ Merged
Merged: 11/1/2025
Merged by: @adamhathcock
Base:
master← Head:adam/async-lzma📝 Commits (10+)
321233bsome async implementationsd4f11e0some more async changes53c9619format60e1dc0review fixese1e9c44use proper async versionsa669de2Merge remote-tracking branch 'origin/master' into adam/async-lzma74e2dcafmt1e22b47some fixesc53ca37don't use pools in tests7fa271afix ILLink📊 Changes
18 files changed (+1574 additions, -179 deletions)
View changed files
📝
Directory.Packages.props(+1 -0)📝
src/SharpCompress/Compressors/LZMA/AesDecoderStream.cs(+67 -0)📝
src/SharpCompress/Compressors/LZMA/Bcj2DecoderStream.cs(+14 -0)📝
src/SharpCompress/Compressors/LZMA/LZ/LzOutWindow.cs(+134 -0)📝
src/SharpCompress/Compressors/LZMA/LZipStream.cs(+26 -0)📝
src/SharpCompress/Compressors/LZMA/LzmaDecoder.cs(+177 -25)📝
src/SharpCompress/Compressors/LZMA/LzmaStream.cs(+201 -0)📝
src/SharpCompress/Compressors/LZMA/Utilites/CrcBuilderStream.cs(+20 -0)📝
src/SharpCompress/Compressors/LZMA/Utilites/CrcCheckStream.cs(+17 -1)📝
src/SharpCompress/SharpCompress.csproj(+3 -0)📝
src/SharpCompress/packages.lock.json(+3 -3)➕
tests/SharpCompress.Test/Streams/LzmaStreamAsyncTests.cs(+606 -0)📝
tests/SharpCompress.Test/Streams/LzmaStreamTests.cs(+1 -2)➕
tests/SharpCompress.Test/Streams/RewindableStreamAsyncTest.cs(+96 -0)📝
tests/SharpCompress.Test/Streams/SharpCompressStreamAsyncTests.cs(+73 -110)📝
tests/SharpCompress.Test/Streams/SharpCompressStreamTest.cs(+4 -10)➕
tests/SharpCompress.Test/Streams/ZLibBaseStreamAsyncTests.cs(+112 -0)📝
tests/SharpCompress.Test/Tar/TarReaderAsyncTests.cs(+19 -28)📄 Description
Related to https://github.com/adamhathcock/sharpcompress/issues/992
This pull request adds asynchronous read and write support to several LZMA-related stream classes, enhancing their compatibility with modern .NET patterns and improving performance in I/O-bound scenarios. The changes include implementing
ReadAsyncandWriteAsyncmethods, handling cancellation tokens, and updating internal logic to support async operations across the codebase.Async I/O Support Across Stream Classes
ReadAsyncandWriteAsyncmethods inLzmaStream, including an async version ofDecodeChunkHeaderto support asynchronous chunk decoding and data reading. [1] [2]ReadAsyncandWriteAsyncmethods toLZipStream, supporting bothMemory<byte>andbyte[]overloads for async operations, and delegated async calls to the underlying stream. [1] [2]AesDecoderStreamby implementingReadAsyncwith proper buffer management and cancellation handling.Async Write Support in Utility Streams
WriteAsynctoCrcBuilderStream, updating CRC asynchronously and supporting cancellation tokens.WriteAsyncinCrcCheckStream, allowing asynchronous CRC checking during write operations.Async Compatibility in Decoder Streams
ReadAsyncinBcj2DecoderStream, wrapping the synchronousReadmethod for compatibility with async APIs and cancellation tokens.These updates ensure that all major LZMA stream classes in the codebase now support asynchronous I/O, making them suitable for modern, high-performance applications that require non-blocking operations.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.