Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpBaseStream Gzip extract - NotSupportedException #843

Open
Ilanlido opened this issue May 18, 2024 · 4 comments
Open

HttpBaseStream Gzip extract - NotSupportedException #843

Ilanlido opened this issue May 18, 2024 · 4 comments

Comments

@Ilanlido
Copy link

Ilanlido commented May 18, 2024

Hi, looks like when trying to decompress a gzip through httpStream it throws NotSupportedException on Position when setting EntryStartPosition. what is the purpose of settings this field? how can i mitigate the problem? Thanks!

System.NotSupportedException: Specified method is not supported.
   at System.Net.Http.HttpBaseStream.get_Position()
   at SharpCompress.IO.RewindableStream.get_Position()
   at SharpCompress.Common.GZip.GZipFilePart..ctor(Stream stream, ArchiveEncoding archiveEncoding)
   at SharpCompress.Common.GZip.GZipEntry.GetEntries(Stream stream, OptionsBase options)+MoveNext()

P.S i'd prefer to not save the file to disk and read it again as FileStream if possible
If that's not possible which types require random access? i know that .tar.gz works perfectly fine through http for example, Thanks in advance!

@adamhathcock
Copy link
Owner

You'll have to show me how you're calling things.

GZipFilePart does check CanSeek but Rewindable is meant to buffer unbufferable streams so shouldn't be used here.

@adamhathcock
Copy link
Owner

Actually, I take that back, GZipFilePart has a usage of Position no matter seeking. That should be changed

@Ilanlido
Copy link
Author

I'm not familiar with the internals of how Gzip works, but again, why do we need EntryStartPosition? isn't there only one entry always in .gz? maybe i can help :)

@adamhathcock
Copy link
Owner

you're right but I'm not sure why I'm doing that....I'd have to look and remember

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants