-
Notifications
You must be signed in to change notification settings - Fork 497
Open
Description
XZStream tries to get a position from a stream and this isn't supported for non-seekable streams.
A simple repro:
using System.Net.Http;
using SharpCompress.Compressors.Xz;
new XZStream(await new HttpClient()
.GetStreamAsync("https://deb.debian.org/debian/dists/bookworm/main/binary-amd64/Packages.xz"))
.ReadByte();
will throw
System.NotSupportedException: Specified method is not supported.
at System.Net.Http.HttpBaseStream.get_Position()
at SharpCompress.Compressors.Xz.XZBlock..ctor(Stream stream, CheckType checkType, Int32 checkSize)
at SharpCompress.Compressors.Xz.XZStream.NextBlock()
at SharpCompress.Compressors.Xz.XZStream.ReadBlocks(Byte[] buffer, Int32 offset, Int32 count)
at SharpCompress.Compressors.Xz.XZStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.ReadByte()
at Program.<<Initialize>>d__0.MoveNext() in :line 5
Metadata
Metadata
Assignees
Labels
No labels