mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 13:34:57 +00:00
[PR #991] [MERGED] Add more Async tests and complete Zip tests #1410
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/991
Author: @adamhathcock
Created: 10/28/2025
Status: ✅ Merged
Merged: 10/28/2025
Merged by: @adamhathcock
Base:
master← Head:async-reader-methods📝 Commits (10+)
72d5884added async reader overloadsf6eabc5Merge remote-tracking branch 'origin/master' into async-reader-methodsc68d8deadd async testse287d08minor clean up16ad86cadd async implementations to readonlysubstream79653eeMerge remote-tracking branch 'origin/master' into async-reader-methodsa1de3ebadd async tests and clean up deflate64stream19967f5allow forward only write42f7d43enable zip64 tests that pass06713c6async deflate 64📊 Changes
14 files changed (+1331 additions, -82 deletions)
View changed files
📝
src/SharpCompress/Common/Zip/StreamingZipHeaderFactory.cs(+2 -3)📝
src/SharpCompress/Compressors/Deflate64/Deflate64Stream.cs(+110 -73)📝
src/SharpCompress/IO/ReadOnlySubStream.cs(+43 -0)📝
src/SharpCompress/Readers/AbstractReader.cs(+75 -0)📝
src/SharpCompress/Readers/IReader.cs(+14 -0)📝
src/SharpCompress/packages.lock.json(+3 -3)📝
tests/SharpCompress.Test/Mocks/ForwardOnlyStream.cs(+35 -2)📝
tests/SharpCompress.Test/ReaderTests.cs(+1 -1)➕
tests/SharpCompress.Test/Zip/Zip64AsyncTests.cs(+242 -0)📝
tests/SharpCompress.Test/Zip/Zip64Tests.cs(+8 -0)➕
tests/SharpCompress.Test/Zip/ZipArchiveAsyncTests.cs(+196 -0)➕
tests/SharpCompress.Test/Zip/ZipMemoryArchiveWithCrcAsyncTests.cs(+281 -0)➕
tests/SharpCompress.Test/Zip/ZipReaderAsyncTests.cs(+254 -0)➕
tests/SharpCompress.Test/Zip/ZipWriterAsyncTests.cs(+67 -0)📄 Description
This pull request introduces asynchronous support to the SharpCompress library, enabling non-blocking operations for reading and skipping entries in compressed archives. The changes add async methods to core stream and reader classes, improve compatibility with modern .NET features, and update tests and mocks to support async operations. Additionally, some code cleanup and minor refactoring are included.
Async API additions and enhancements:
ReadAsyncandValueTask<int> ReadAsyncmethods toDeflate64StreamandReadOnlySubStreamto support asynchronous decompression and reading, including handling forMemory<byte>buffers on modern .NET platforms. [1] [2]MoveToNextEntryAsyncandOpenEntryStreamAsyncin bothIReaderinterface andAbstractReaderclass, allowing entries to be processed asynchronously. [1] [2] [3]SkipEntryAsyncandSkipAsyncinAbstractReader, enabling efficient skipping of entries without blocking. [1] [2]Test and mock updates for async support:
ForwardOnlyStreammock to implement async read/write/flush methods, and adjustedCanWriteto support writing, improving test coverage for async scenarios. [1] [2]ReaderTeststo use the new async reader API, ensuring tests validate asynchronous behavior.Codebase cleanup and minor refactoring:
Deflate64Stream, simplified property implementations, and updated disposal logic for better resource management. [1] [2] [3] [4] [5]StreamingZipHeaderFactoryfor improved code clarity. [1] [2]Dependency update:
Microsoft.NET.ILLink.Taskspackage version inpackages.lock.jsonfor compatibility.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.