Skip to content

Commit 2c0d1a4

Browse files
authored
fix NetworkStream reading example description (#10898)
Remove incorrect DataAvailable reference and clarify buffer usage
1 parent 85ff7af commit 2c0d1a4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

xml/System.Net.Sockets/NetworkStream.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,8 +1562,7 @@ There is a failure reading from the network.</exception>
15621562
15631563
15641564
## Examples
1565-
The following code example uses <xref:System.Net.Sockets.NetworkStream.DataAvailable%2A> to determine if data is available to be read. If data is available, it reads from the <xref:System.Net.Sockets.NetworkStream>.
1566-
1565+
The following code example reads data from the <xref:System.Net.Sockets.NetworkStream> into a buffer. If data is available, it continues reading until the end of the stream is reached, appending the received data to a <xref:System.Text.StringBuilder>.
15671566
:::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/NetworkStream/Overview/source.cs" id="Snippet4":::
15681567
15691568
]]></format>

0 commit comments

Comments
 (0)