Skip to content

Commit 7913f80

Browse files
authored
Update bufferSize unit and ArgumentOutOfRangeException descriptions
1 parent 41f5560 commit 7913f80

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

xml/System.IO/StreamReader.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@
10081008
<exception cref="T:System.ArgumentNullException">
10091009
<paramref name="stream" /> or <paramref name="encoding" /> is <see langword="null" />.</exception>
10101010
<exception cref="T:System.ArgumentOutOfRangeException">
1011-
<paramref name="bufferSize" /> is less than or equal to zero.</exception>
1011+
<paramref name="bufferSize" /> is less than or equal to zero, except for -1, which is allowed in stream-based constructors to indicate the default buffer size.</exception>
10121012
<altmember cref="T:System.Text.Encoding" />
10131013
<related type="Article" href="/dotnet/standard/io/">File and Stream I/O</related>
10141014
<related type="Article" href="/dotnet/standard/io/how-to-read-text-from-a-file">How to: Read Text from a File</related>
@@ -1115,7 +1115,7 @@
11151115
<exception cref="T:System.NotSupportedException">
11161116
<paramref name="path" /> includes an incorrect or invalid syntax for file name, directory name, or volume label.</exception>
11171117
<exception cref="T:System.ArgumentOutOfRangeException">
1118-
<paramref name="bufferSize" /> is less than or equal to zero.</exception>
1118+
<paramref name="bufferSize" /> is less than or equal to zero, except for -1, which is allowed in stream-based constructors to indicate the default buffer size.</exception>
11191119
<altmember cref="T:System.Text.Encoding" />
11201120
<related type="Article" href="/dotnet/standard/io/">File and Stream I/O</related>
11211121
<related type="Article" href="/dotnet/standard/io/how-to-read-text-from-a-file">How to: Read Text from a File</related>

xml/System.IO/StreamWriter.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@
612612
<Docs>
613613
<param name="stream">The stream to write to.</param>
614614
<param name="encoding">The character encoding to use.</param>
615-
<param name="bufferSize">The buffer size, in bytes.</param>
615+
<param name="bufferSize">The buffer size, in characters.</param>
616616
<summary>Initializes a new instance of the <see cref="T:System.IO.StreamWriter" /> class for the specified stream by using the specified encoding and buffer size.</summary>
617617
<remarks>
618618
<format type="text/markdown"><![CDATA[
@@ -640,7 +640,7 @@
640640
<exception cref="T:System.ArgumentNullException">
641641
<paramref name="stream" /> or <paramref name="encoding" /> is <see langword="null" />.</exception>
642642
<exception cref="T:System.ArgumentOutOfRangeException">
643-
<paramref name="bufferSize" /> is negative.</exception>
643+
<paramref name="bufferSize" /> is less than or equal to zero, except for -1, which is allowed in stream-based constructors to indicate the default buffer size.</exception>
644644
<exception cref="T:System.ArgumentException">
645645
<paramref name="stream" /> is not writable.</exception>
646646
<altmember cref="T:System.Text.Encoding" />
@@ -871,7 +871,7 @@
871871
<Docs>
872872
<param name="stream">The stream to write to.</param>
873873
<param name="encoding">The character encoding to use.</param>
874-
<param name="bufferSize">The buffer size, in bytes.</param>
874+
<param name="bufferSize">The buffer size, in characters.</param>
875875
<param name="leaveOpen">
876876
<see langword="true" /> to leave the stream open after the <see cref="T:System.IO.StreamWriter" /> object is disposed; otherwise, <see langword="false" />.</param>
877877
<summary>Initializes a new instance of the <see cref="T:System.IO.StreamWriter" /> class for the specified stream by using the specified encoding and buffer size, and optionally leaves the stream open.</summary>
@@ -899,7 +899,7 @@
899899
<exception cref="T:System.ArgumentNullException">
900900
<paramref name="stream" /> or <paramref name="encoding" /> is <see langword="null" />.</exception>
901901
<exception cref="T:System.ArgumentOutOfRangeException">
902-
<paramref name="bufferSize" /> is negative.</exception>
902+
<paramref name="bufferSize" /> is less than or equal to zero, except for -1, which is allowed in stream-based constructors to indicate the default buffer size.</exception>
903903
<exception cref="T:System.ArgumentException">
904904
<paramref name="stream" /> is not writable.</exception>
905905
</Docs>
@@ -967,7 +967,7 @@
967967
<param name="append">
968968
<see langword="true" /> to append data to the file; <see langword="false" /> to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file.</param>
969969
<param name="encoding">The character encoding to use.</param>
970-
<param name="bufferSize">The buffer size, in bytes.</param>
970+
<param name="bufferSize">The buffer size, in characters.</param>
971971
<summary>Initializes a new instance of the <see cref="T:System.IO.StreamWriter" /> class for the specified file on the specified path, using the specified encoding and buffer size. If the file exists, it can be either overwritten or appended to. If the file does not exist, this constructor creates a new file.</summary>
972972
<remarks>
973973
<format type="text/markdown"><![CDATA[
@@ -1003,7 +1003,7 @@
10031003
<exception cref="T:System.ArgumentNullException">
10041004
<paramref name="path" /> or <paramref name="encoding" /> is <see langword="null" />.</exception>
10051005
<exception cref="T:System.ArgumentOutOfRangeException">
1006-
<paramref name="bufferSize" /> is negative.</exception>
1006+
<paramref name="bufferSize" /> is less than or equal to zero, except for -1, which is allowed in stream-based constructors to indicate the default buffer size.</exception>
10071007
<exception cref="T:System.IO.IOException">
10081008
<paramref name="path" /> includes an incorrect or invalid syntax for file name, directory name, or volume label syntax.</exception>
10091009
<exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>

0 commit comments

Comments
 (0)