mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-09 21:24:08 +00:00
[PR #1002] [MERGED] async bzip2 and add #1420
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/1002
Author: @adamhathcock
Created: 10/30/2025
Status: ✅ Merged
Merged: 10/31/2025
Merged by: @adamhathcock
Base:
master← Head:adam/async-bzip2📝 Commits (4)
bc06f31add basics for async bzip2a136084add adc asynceb18805fmtccc8587review fixes📊 Changes
9 files changed (+620 additions, -3 deletions)
View changed files
📝
src/SharpCompress/Compressors/ADC/ADCBase.cs(+186 -0)📝
src/SharpCompress/Compressors/ADC/ADCStream.cs(+72 -0)📝
src/SharpCompress/Compressors/BZip2/BZip2Stream.cs(+27 -1)📝
src/SharpCompress/Compressors/BZip2/CBZip2InputStream.cs(+24 -0)📝
src/SharpCompress/Compressors/BZip2/CBZip2OutputStream.cs(+17 -0)📝
src/SharpCompress/Writers/Zip/ZipWriter.cs(+2 -2)➕
tests/SharpCompress.Test/AdcAsyncTest.cs(+61 -0)➕
tests/SharpCompress.Test/BZip2/BZip2StreamAsyncTests.cs(+231 -0)📝
tests/SharpCompress.Test/Rar/RarCRCTest.cs(+0 -0)📄 Description
Related to https://github.com/adamhathcock/sharpcompress/issues/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.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.