Skip to content

Using wrong variable in the example #9101

@AndreasRoland

Description

@AndreasRoland

Hi
In the example, the following line isn't correct, if you want to show how FileStream is used:
String decodedString = utf8.GetString(encodedBytes);
It should be:
String decodedString = utf8.GetString(bytes);
because 'bytes' has been read from FileStream.
Using 'encodedBytes' you would simply proof that utf8.GetString is the reverse operation of utf8.GetBytes.

Nevertheless it's a very good example. Thank you
Andreas


Document Details

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions