Skip to content

PipeStream not supporting Read offsets > 0 #440

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

Closed
Noggog opened this issue Jun 19, 2018 · 1 comment · Fixed by #1399
Closed

PipeStream not supporting Read offsets > 0 #440

Noggog opened this issue Jun 19, 2018 · 1 comment · Fixed by #1399

Comments

@Noggog
Copy link

Noggog commented Jun 19, 2018

PipeStream seems to throw an exception when Read(byte[] buffer, int offset, int count) is called, with an offset above zero.
https://github.com/sshnet/SSH.NET/blob/master/src/Renci.SshNet/Common/PipeStream.cs#L183

Is there a reason it cannot support this? Seems like it would be easy enough to modify the for loop to start at the desired offset, and still calculate the amount read properly.

If it's just something that hasn't been done yet, I can perhaps do the work, but I wanted to check first to see if there's some edge case that makes this feature N/A that I'm not seeing.

Thanks!

@KSebion
Copy link

KSebion commented Dec 21, 2021

I am wondering the same thing.
Ran into this exception while using System.IO.Pipelines.PipeReader.
Then rewrote my code to use the raw stream and encountered it again.

Thanks.

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