dotnet / dotnet/dotnet-api-docs

ReadBlockAsync docs unclear on difference to ReadAsync

Open
#1,027 1 comment 7 reactions 0 assignees View on GitHub
area-System.IO dotnet-api/prod Pri2
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

The docs for ReadBlockAsync are almost identical to the docs for ReadAsync but their behavior is quite different. ReadBlockAsync appears to try and fill the buffer with `count` characters before returning, only returning early if the stream ended. ReadAsync on the other hand appears to fill a maximum of `count` characters, but will return early if there is no more data ready for reading.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 3988e630-dd5b-611e-7767-4c5aec0622ae
* Version Independent ID: 9169e86f-d936-61f7-243e-a3d2816fb170
* Content: [StreamReader.ReadBlockAsync Method (System.IO)](https://docs.microsoft.com/en-us/dotnet/api/system.io.streamreader.readblockasync?view=netframework-4.7.2)
* Content Source: [xml/System.IO/StreamReader.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.IO/StreamReader.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.