mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-13 05:25:00 +00:00
XZStream doesn't support non-seekable streams #694
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?
Originally created by @montoner0 on GitHub (Aug 13, 2025).
XZStream tries to get a position from a stream and this isn't supported for non-seekable streams.
A simple repro:
will throw
@Nanook commented on GitHub (Aug 14, 2025):
I'll look at this
@adamhathcock commented on GitHub (Oct 13, 2025):
I think this was fixed by https://github.com/adamhathcock/sharpcompress/pull/930
@montoner0 commented on GitHub (Oct 13, 2025):
I don't think so. v0.41.0 still crashes
@adamhathcock commented on GitHub (Oct 14, 2025):
If you wrap the HttpResponseStream in a
SharpCompressStream.Createit works. This new stream class handles some of the random access needed by certain compressions@montoner0 commented on GitHub (Oct 14, 2025):
Then I guess it should be documented somehow. It's quite not obvious.
And strictly speaking the issue is still valid since XZStream doesn't support such streams even though there's a workaround.
@adamhathcock commented on GitHub (Oct 15, 2025):
I'm not saying it isn't an issue, it's just not documented as the way to do things is with the Reader/Writer/Archive interfaces.
From a basic search, XZ itself doesn't support forward only access in all scenarios.