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

NotSupportedException for forward-only reading of unseekable ConnectStream #160

Closed
AlexVallat opened this issue Aug 12, 2016 · 5 comments
Closed

Comments

@AlexVallat
Copy link

When using ZipReader over the ConnectStream obtained from a HttpWebResponse, it fails at the second call of MoveToNextEntry due to attempting to access the .Position of the underlying stream. ConnectStream does not support .Position as it does not support seeking.

@adamhathcock
Copy link
Owner

Can you give me the full stack trace? It definitely shouldn't be doing that.

@adamhathcock
Copy link
Owner

Never mind, I reproduced it.

@AlexVallat
Copy link
Author

Just in case, I might as well post the stack anyway now that I've captured it:

System.NotSupportedException: This stream does not support seek operations.
   at System.Net.ConnectStream.get_Position()
   at SharpCompress.IO.NonDisposingStream.get_Position() in d:\dev\SharpCompress\src\SharpCompress\IO\NonDisposingStream.cs:line 46
   at SharpCompress.IO.RewindableStream.get_Position() in d:\dev\SharpCompress\src\SharpCompress\IO\RewindableStream.cs:line 97
   at SharpCompress.Common.Zip.StreamingZipHeaderFactory.<ReadStreamHeader>d__0.MoveNext() in d:\dev\SharpCompress\src\SharpCompress\Common\Zip\StreamingZipHeaderFactory.cs:line 34
   at SharpCompress.Reader.Zip.ZipReader.<GetEntries>d__0.MoveNext() in d:\dev\SharpCompress\src\SharpCompress\Reader\Zip\ZipReader.cs:line 46
   at SharpCompress.Reader.AbstractReader`2.NextEntryForCurrentStream() in d:\dev\SharpCompress\src\SharpCompress\Reader\AbstractReader.cs:line 137
   at SharpCompress.Reader.AbstractReader`2.MoveToNextEntry() in d:\dev\SharpCompress\src\SharpCompress\Reader\AbstractReader.cs:line 102

@AlexVallat
Copy link
Author

Thanks for the quick response!

@adamhathcock
Copy link
Owner

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