dotnet / dotnet/dotnet-api-docs
System.IO.StreamWriter Constructor with BufferSize Argument
- 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
Assessment
This issue has not been assessed yet.