dotnet / dotnet/dotnet-api-docs

System.IO.StreamWriter Constructor with BufferSize Argument

Open
#4,841 2 comments 1 reaction 0 assignees View on GitHub
area-System.IO Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

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

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.