mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #976] [CLOSED] Add async/await support for all Stream I/O operations #1392
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/976
Author: @Copilot
Created: 10/25/2025
Status: ❌ Closed
Base:
master← Head:copilot/convert-stream-access-to-async📝 Commits (7)
06deca5Initial plan8f54cd4Initial commit - Planning async Stream conversion3404607Add async infrastructure to core I/O classes and interfacesfcb3838Implement async methods across all Archive entries and extension methods7799d2dUpdate README and USAGE documentation with async examples999a1ebAdd comprehensive async tests demonstrating new functionality1cd2459Fix test to use deterministic DateTime value per code review📊 Changes
20 files changed (+1083 additions, -15 deletions)
View changed files
📝
README.md(+78 -0)📝
USAGE.md(+143 -0)📝
src/SharpCompress/Archives/GZip/GZipArchiveEntry.cs(+8 -0)📝
src/SharpCompress/Archives/IArchiveEntry.cs(+8 -0)📝
src/SharpCompress/Archives/Rar/RarArchiveEntry.cs(+5 -0)📝
src/SharpCompress/Archives/SevenZip/SevenZipArchiveEntry.cs(+5 -0)📝
src/SharpCompress/Archives/Tar/TarArchiveEntry.cs(+5 -0)📝
src/SharpCompress/Archives/Zip/ZipArchiveEntry.cs(+5 -0)📝
src/SharpCompress/Common/ExtractionMethods.cs(+113 -0)📝
src/SharpCompress/IO/SharpCompressStream.cs(+139 -12)📝
src/SharpCompress/IO/SourceStream.cs(+102 -0)📝
src/SharpCompress/Readers/AbstractReader.cs(+38 -0)📝
src/SharpCompress/Readers/IReader.cs(+9 -0)📝
src/SharpCompress/Readers/IReaderExtensions.cs(+62 -0)📝
src/SharpCompress/Utility.cs(+135 -0)📝
src/SharpCompress/Writers/AbstractWriter.cs(+15 -0)📝
src/SharpCompress/Writers/IWriter.cs(+8 -0)📝
src/SharpCompress/Writers/IWriterExtensions.cs(+69 -0)📝
src/SharpCompress/packages.lock.json(+3 -3)➕
tests/SharpCompress.Test/AsyncTests.cs(+133 -0)📄 Description
All I/O operations now support async/await with CancellationToken. Methods performing async operations are suffixed with
Async.Changes
Core Infrastructure
SharpCompressStream,SourceStream- AddedReadAsync(),WriteAsync(),FlushAsync()TransferToAsync(),SkipAsync()with CancellationToken supportPublic APIs
IReader.WriteEntryToAsync()- Extract entries asynchronouslyIWriter.WriteAsync()- Write entries asynchronouslyIArchiveEntry.OpenEntryStreamAsync()- Open entry streams asynchronouslyExtension Methods
reader.WriteAllToDirectoryAsync()- Bulk async extractionwriter.WriteAllAsync()- Bulk async compressionCancellationTokenArchive Format Support
Usage
Async Reading:
Async Writing:
Async Entry Access:
Compatibility
Documentation
AsyncTests.cswith 6 async scenariosOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.