Suggest using streamreader instead of iterating over the stream

Open Beginner friendly
#33,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
documentation

Research direction

Open docs/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams.md and locate the recommended section. Update it to suggest using StreamReader with CryptoStream as shown in the issue instead of manually iterating over the stream. Confirm the example and surrounding guidance accurately describe the recommended approach.

Written by the indexing model from the issue text.

Description

dotnet-fundamentals/svc help wanted

In the recommended section, you should suggest the use of StreamReader instead of manually iterating over the Stream :
using (var plainTextReader = new StreamReader(cryptoStream))
{
return plainTextReader.ReadToEnd();
}

reference : https://stackoverflow.com/questions/69911084/problem-updating-to-net-6-encrypting-string

Thanks !


Document Details

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

Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 30m
Merged PRs (30d)
374

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/docs

All issues in dotnet/docs

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.