System.IO.StreamWriter Constructor with BufferSize Argument

Open Beginner friendly
#4,841 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

Description

area-System.IO Pri3 untriaged

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)

Dominant language
C#
Stars
950
Forks
1.7k
Avg merge
3d 5h
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/dotnet-api-docs

All issues in dotnet/dotnet-api-docs

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.