mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #1004] Async XZ #1425
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?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/1004
State: closed
Merged: Yes
related to: https://github.com/adamhathcock/sharpcompress/issues/992
This pull request adds asynchronous support to the XZ decompression library, enabling non-blocking operations for reading and processing XZ archives. The main changes include introducing async versions of core parsing and validation methods, updating stream and binary reader utilities to support async reads, and ensuring that all major XZ format components (header, block, index, footer) can be processed asynchronously.
Async API additions for XZ format components:
XZHeader,XZBlock,XZIndex,XZIndexRecord, andXZFooter, allowing these classes to be read and validated asynchronously from streams. [1] [2] [3] [4] [5]Async stream and binary reader utilities:
BinaryUtils.csandMultiByteIntegers.csfor reading little-endian integers and multi-byte XZ integers from streams andBinaryReader. These include cancellation token support. [1] [2]Async parsing logic in XZBlock and XZIndex:
XZBlockandXZIndexto provide async versions of header loading, padding skipping, CRC checking, and marker verification, ensuring all parsing steps can be performed asynchronously. [1] [2] [3] [4] [5] [6] [7] [8]Async CRC and validation routines:
XZHeader,XZFooter, andXZIndexto use async reads and CRC calculations, supporting cancellation. [1] [2] [3]General infrastructure updates:
usingstatements forSystem.ThreadingandSystem.Threading.Tasksto all relevant files to support async functionality. [1] [2] [3] [4] [5] [6] [7] [8]