-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Improve consistency of StreamReader and StreamWriter #118958
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
Conversation
src/libraries/System.Runtime/tests/System.IO.Tests/StreamWriter/StreamWriter.StringCtorTests.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. @jozkee; I'd like you and @ViveliDuCh to review this together and make sure nothing else needs to be changed at the same time.
After this is merged, please create a PR to update the API docs to add a remark about this behavior too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments to consider, thanks.
src/libraries/System.Private.CoreLib/src/System/IO/StreamWriter.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Runtime/tests/System.IO.Tests/StreamReader/StreamReader.StringCtorTests.cs
Show resolved
Hide resolved
@ViveliDuCh . Sry, what's the meaning of commit e937c9d ? Is this means the improvements are no longer suggested, or they should be commited by myself instead of a reviewer? |
Thanks for asking! |
// Creates a new StreamReader for the given stream. The | ||
// character encoding is set by encoding and the buffer size, | ||
// in number of 16-bit characters, is set by bufferSize. | ||
// in bytes, is set by bufferSize. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also submit a PR to https://github.com/dotnet/dotnet-api-docs/ to make this change in the official API docs?
(The file to edit is https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.IO/StreamReader.xml)
* Enhance consistency of StreamReader and StreamWriter * Fix path missing error in StringCtorTests of StreamReader and StreamWriter * Fix a param error in StreamWriter.StringCtorTests.cs * PR change suggestions * Revert change for constructors * Fix whitespace * Add buffer size test in stream ctor tests --------- Co-authored-by: Viviana Dueñas <[email protected]>
Fix #118748
DefaultFileStreamBufferSize
.DefaultBufferSize
(1024) as the default param of the constructor overload that takesFileStreamOptions
inStreamWriter
.ArgumentOutOfRangeException
.