dotnet / dotnet/dotnet-api-docs

System.IO.StreamWriter Constructor with BufferSize Argument

Open Beginner friendly
#4,841 2 comments 1 reaction 0 assignees View on GitHub
area-System.IO Pri3 untriaged
Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
52

Description

The documentation for `public StreamWriter (System.IO.Stream stream, System.Text.Encoding encoding, int bufferSize)` states that an `ArgumentOutOfRangeException` will be thrown if _`bufferSize` is negative_. That statement is incorrect as it implies that a value of zero will not throw an exception. The corresponding documentation for `public StreamReader (System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize)` is correct as it states that an `ArgumentOutOfRangeException` will be thrown if _`bufferSize` is less than or equal to zero._

[public StreamWriter (System.IO.Stream stream, System.Text.Encoding encoding, int bufferSize)](https://docs.microsoft.com/en-us/dotnet/api/system.io.streamwriter.-ctor?view=netframework-4.8#System_IO_StreamWriter__ctor_System_IO_Stream_System_Text_Encoding_System_Int32_)

Contributor guide

Open the contributing guide

Research direction

Open the linked StreamWriter constructor documentation and compare its bufferSize exception wording with the corresponding StreamReader constructor documentation. Confirm that the documented condition matches the API behavior and that the rendered page clearly states the zero-value case; the issue is done when the incorrect wording is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.