Skip to content

Commit

Permalink
fix NetworkStream reading example description (dotnet#10898)
Browse files Browse the repository at this point in the history
Remove incorrect DataAvailable reference and clarify buffer usage
  • Loading branch information
flafarga authored Feb 3, 2025
1 parent 85ff7af commit 2c0d1a4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xml/System.Net.Sockets/NetworkStream.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,7 @@ There is a failure reading from the network.</exception>
## Examples
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>.
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>.
:::code language="csharp" source="~/snippets/csharp/System.Net.Sockets/NetworkStream/Overview/source.cs" id="Snippet4":::
]]></format>
Expand Down

0 comments on commit 2c0d1a4

Please sign in to comment.