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

Support writing base64 JSON segments #111041

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

PranavSenthilnathan
Copy link
Member

Adds support to the Utf8JsonWriter for writing string value segments of byte[] encoded as Base64 UTF-8.

Closes #67337

Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

}

/// <summary>
/// The partial UTF-8 code point.
/// </summary>
private ReadOnlySpan<byte> PartialUtf8CodePoint
private ReadOnlySpan<byte> PartialUtf8StringData
{
get
{
Debug.Assert(PreviousSegmentEncoding == SegmentEncoding.Utf8);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing PreviousSegmentEncoding would eventually be replaced by "enclosing container" data as introduced in #111332

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That PR doesn't do it but it could in order to avoid the bit twiddling that PreviousSegmentEncoding currently does.

@PranavSenthilnathan
Copy link
Member Author

/ba-g There are known infrastructure errors and test errors. The other build failure was an unrelated timeout affecting other PRs.

@PranavSenthilnathan PranavSenthilnathan merged commit 2bfe21b into dotnet:main Jan 14, 2025
78 of 82 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to stream large strings in Utf8JsonWriter/Utf8JsonReader
2 participants