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

fix(StreamExt/ReadBytes): now throws EndOfStreamException when the en… #255

Merged

Conversation

LaoSparrow
Copy link
Contributor

…d of the stream is reached

Copy link
Member

@sgkoishi sgkoishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or perhaps we are moving away from these StreamExt?

@@ -217,18 +217,12 @@ public static byte[] ReadBytes(this Stream s, int count)
int num2 = s.Read(array, num, count);
if (num2 == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will throw EndOfStream if the original count == 0, where 0 is somehow expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let me add a check here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or use while do instead of do while?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@LaoSparrow LaoSparrow force-pushed the streamext-readstring-eos branch from 07e4425 to 87792be Compare March 1, 2025 04:04
@pull-request-size pull-request-size bot added size/S and removed size/XS labels Mar 1, 2025
@hakusaro hakusaro merged commit 29dc46f into Pryaxis:general-devel Mar 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants