Skip to content

Commit bfceb6f

Browse files
authored
Updated docs on CopyTo(Stream, Int32) (#7966)
The old documentation did not make it clear that the write or read positions were advanced at all. This can lead to a lot of confusion for programmers when they attempt to use this method.
1 parent 0b65078 commit bfceb6f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

xml/System.IO/Stream.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@
655655
<AssemblyVersion>4.1.0.0</AssemblyVersion>
656656
</AssemblyInfo>
657657
<Docs>
658-
<summary>Reads the bytes from the current stream and writes them to another stream.</summary>
658+
<summary>Reads the bytes from the current stream and writes them to another stream. Both streams positions are advanced by the number of bytes copied.</summary>
659659
</Docs>
660660
</MemberGroup>
661661
<Member MemberName="CopyTo">
@@ -699,7 +699,7 @@
699699
</Parameters>
700700
<Docs>
701701
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
702-
<summary>Reads the bytes from the current stream and writes them to another stream.</summary>
702+
<summary>Reads the bytes from the current stream and writes them to another stream. Both streams positions are advanced by the number of bytes copied.</summary>
703703
<remarks>
704704
<format type="text/markdown"><![CDATA[
705705
@@ -775,7 +775,7 @@
775775
<Docs>
776776
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
777777
<param name="bufferSize">The size of the buffer. This value must be greater than zero. The default size is 81920.</param>
778-
<summary>Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.</summary>
778+
<summary>Reads the bytes from the current stream and writes them to another stream, using a specified buffer size. Both streams positions are advanced by the number of bytes copied.</summary>
779779
<remarks>
780780
<format type="text/markdown"><![CDATA[
781781
@@ -805,7 +805,7 @@
805805
<AssemblyVersion>4.1.0.0</AssemblyVersion>
806806
</AssemblyInfo>
807807
<Docs>
808-
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream.</summary>
808+
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream. Both streams positions are advanced by the number of bytes copied.</summary>
809809
</Docs>
810810
</MemberGroup>
811811
<Member MemberName="CopyToAsync">
@@ -855,7 +855,7 @@
855855
</Parameters>
856856
<Docs>
857857
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
858-
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream.</summary>
858+
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream. Both streams positions are advanced by the number of bytes copied.</summary>
859859
<returns>A task that represents the asynchronous copy operation.</returns>
860860
<remarks>
861861
<format type="text/markdown"><![CDATA[
@@ -930,7 +930,7 @@
930930
<Docs>
931931
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
932932
<param name="bufferSize">The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.</param>
933-
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.</summary>
933+
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size. Both streams positions are advanced by the number of bytes copied.</summary>
934934
<returns>A task that represents the asynchronous copy operation.</returns>
935935
<remarks>
936936
<format type="text/markdown"><![CDATA[
@@ -988,7 +988,7 @@
988988
<Docs>
989989
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
990990
<param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
991-
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified cancellation token.</summary>
991+
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified cancellation token. Both streams positions are advanced by the number of bytes copied.</summary>
992992
<returns>A task that represents the asynchronous copy operation.</returns>
993993
<remarks>
994994
<format type="text/markdown"><![CDATA[
@@ -1057,7 +1057,7 @@
10571057
<param name="destination">The stream to which the contents of the current stream will be copied.</param>
10581058
<param name="bufferSize">The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.</param>
10591059
<param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="P:System.Threading.CancellationToken.None" />.</param>
1060-
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.</summary>
1060+
<summary>Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token. Both streams positions are advanced by the number of bytes copied.</summary>
10611061
<returns>A task that represents the asynchronous copy operation.</returns>
10621062
<remarks>
10631063
<format type="text/markdown"><![CDATA[

0 commit comments

Comments
 (0)