Skip to content

Conversation

@Helios-vmg
Copy link
Contributor

This is useful when passing the object to C code, as applications often seek() to the end and tell() to find out the length of a stream.

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

@Numpsy
Copy link
Contributor

Numpsy commented May 23, 2020

Hmm, does the current code throw if you do Seek(0, SeekOrigin.End)? (Doesn't seem right if so)

(/Wonders if it should really be throwing at all when you try to seek past the end at all - reading the MS Docs to remind myself, it says Seeking to any location beyond the length of the stream is supported, so perhaps it shouldn't)

@Helios-vmg
Copy link
Contributor Author

Yes, it does throw on Seek(0, End). I think, particularly for an input stream, throwing when seeking beyond the end is useful to detect errors early.

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

Successfully merging this pull request may close these issues.

3 participants