mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-07-22 17:03:07 +00:00
The SyncOnlyStream wrapper is necessary because the LZMA decoder has bugs in its async implementation that cause state corruption (IndexOutOfRangeException, DataErrorException) even with fresh, non-shared streams. Without this wrapper, async operations on LZMA streams fail. The proper fix would be to repair the async bugs in LzmaStream.ReadAsync, Decoder.CodeAsync, and OutWindow async operations, but that requires deep changes to the decoder state machine. Added detailed comments explaining this is a workaround and where the real fix should go. Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>