Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve docs for BinaryData.ToString() #56325

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/libraries/System.Memory.Data/src/System/BinaryData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,16 @@ public static BinaryData FromObjectAsJson<T>(T jsonSerializable, JsonSerializerO
/// <summary>
/// Converts the value of this instance to a string using UTF-8.
/// </summary>
/// <remarks>
/// No special treatment is given to the contents of the data, it is merely decoded as a UTF-8 string.
/// For a JPEG or other binary file format the string will largely be nonsense with many embedded NUL characters,
/// and UTF-8 JSON values will look like their file/network representation,
/// including starting and stopping quotes on a string.
/// </remarks>
/// <returns>
/// A string from the value of this instance, using UTF-8 to decode the bytes.
/// </returns>
/// <seealso cref="ToObjectFromJson{String}" />
public override unsafe string ToString()
{
ReadOnlySpan<byte> span = _bytes.Span;
Expand Down