adds more async tests and overloads to make things writable and async#980
Merged
adamhathcock merged 5 commits intomasterfrom Oct 27, 2025
Merged
adds more async tests and overloads to make things writable and async#980adamhathcock merged 5 commits intomasterfrom
adamhathcock merged 5 commits intomasterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces comprehensive async support for archive operations in SharpCompress, enabling non-blocking save and extraction functionality across GZip, Tar, and Zip archive types. The changes modernize the API to support async/await patterns throughout the library.
Key Changes:
- Added
SaveToAsyncmethods toIWritableArchiveand concrete archive implementations (GZipArchive, TarArchive, ZipArchive) - Introduced
WriteToAsyncandWriteToFileAsyncextension methods forIArchiveEntryto support async extraction - Created comprehensive async unit tests for GZip archives to validate the new async functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/SharpCompress/Archives/IWritableArchive.cs |
Added SaveToAsync method signature to interface |
src/SharpCompress/Archives/IWritableArchiveExtensions.cs |
Added async extension methods for saving archives to files and streams |
src/SharpCompress/Archives/AbstractWritableArchive.cs |
Implemented base SaveToAsync method and added abstract method for derived classes |
src/SharpCompress/Archives/GZip/GZipArchive.cs |
Implemented SaveToAsync with GZip-specific logic and file overloads |
src/SharpCompress/Archives/Tar/TarArchive.cs |
Implemented SaveToAsync for Tar archives |
src/SharpCompress/Archives/Zip/ZipArchive.cs |
Implemented SaveToAsync for Zip archives |
src/SharpCompress/Archives/IArchiveEntryExtensions.cs |
Added WriteToAsync and WriteToFileAsync for async entry extraction |
tests/SharpCompress.Test/GZip/GZipArchiveAsyncTests.cs |
Added async test coverage for GZip archive operations |
tests/SharpCompress.Test/GZip/GZipWriterAsyncTests.cs |
Added async test coverage for GZip writer operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closed
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.
This pull request adds asynchronous support for saving and extracting archives in the SharpCompress library. It introduces new async methods for writing archive entries and saving entire archives, enabling non-blocking I/O operations and cancellation support. The changes span core archive types (Zip, Tar, GZip), extension methods, and add comprehensive async extraction capabilities.
Async archive saving and extraction:
SaveToAsyncmethods toIWritableArchive,AbstractWritableArchive, and their extension classes, allowing archives to be saved asynchronously to streams and files with cancellation support. [1] [2] [3]SaveToAsyncoverrides forZipArchive,TarArchive, andGZipArchiveto asynchronously write archive entries using their respective writers. [1] [2] [3]Async entry extraction:
WriteToAsync,WriteToDirectoryAsync, andWriteToFileAsyncextension methods toIArchiveEntryExtensions, enabling asynchronous extraction of archive entries to streams, directories, or files. [1] [2] [3]Async writer support:
TarWriterwithWriteAsyncmethods for writing entries asynchronously, supporting progress, cancellation, and stream size validation.Testing improvements:
ArchiveTests.csto verify asynchronous archive extraction and ensure correctness of the new async APIs.These changes modernize the library for better scalability and responsiveness in applications that use SharpCompress for large or remote archives.