Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds async support to BZip2 and ADC compression streams in SharpCompress. The changes enable asynchronous read and write operations with cancellation token support for improved performance and responsiveness in async-heavy applications.
- Implements
ReadAsyncandWriteAsyncmethods for BZip2 and ADC streams - Adds async-specific unit tests covering compression, decompression, cancellation, and large data scenarios
- Introduces
AdcDecompressResultclass to encapsulate async decompression results
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SharpCompress.Test/Compressors/BZip2/BZip2StreamAsyncTests.cs | New test file with comprehensive async operation tests for BZip2 streams |
| tests/SharpCompress.Test/AdcAsyncTest.cs | New test file with async operation tests for ADC streams |
| src/SharpCompress/Compressors/BZip2/CBZip2OutputStream.cs | Implements WriteAsync with cancellation support |
| src/SharpCompress/Compressors/BZip2/CBZip2InputStream.cs | Implements ReadAsync with cancellation support |
| src/SharpCompress/Compressors/BZip2/BZip2Stream.cs | Adds async wrapper methods for both array and Memory/Span-based operations |
| src/SharpCompress/Compressors/ADC/ADCStream.cs | Implements ReadAsync with comprehensive validation and cancellation |
| src/SharpCompress/Compressors/ADC/ADCBase.cs | Adds DecompressAsync static method and AdcDecompressResult class |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Nov 28, 2025
This was referenced Dec 8, 2025
This was referenced Dec 15, 2025
This was referenced Dec 22, 2025
This was referenced Jan 5, 2026
This was referenced Jan 12, 2026
This was referenced Jan 19, 2026
This was referenced Jan 26, 2026
This was referenced Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #992
This pull request adds asynchronous read and write support to the ADC and BZip2 compression streams, enabling non-blocking operations and cancellation support. It introduces new async methods and refactors existing classes to handle asynchronous workflows, improving integration with modern .NET applications. Comprehensive tests are also added to verify the correctness and robustness of the new async features.
ADC Compression/Decompression Enhancements
AdcDecompressResultclass to encapsulate results of ADC decompression, including bytes read and output buffer.DecompressAsyncmethods inADCBase.csfor asynchronous decompression of byte arrays and streams, supporting cancellation tokens and buffer pooling.ReadAsyncmethod toADCStream.csto support async reading and decompression with cancellation support.BZip2 Compression/Decompression Enhancements
BZip2Stream.cs, including overloads for bothbyte[]andMemory<byte>buffers, supporting cancellation tokens.CBZip2InputStream.csand async write inCBZip2OutputStream.cs, both with cancellation support. [1] [2]Test Coverage
AdcAsyncTest.csto test asynchronous ADC decompression, chunked reads, and cancellation scenarios.BZip2StreamAsyncTests.csto verify async compression/decompression, multiple async writes, cancellation, and large data handling for BZip2 streams.