Skip to content

Consider removing hard-coded limits for token sizes while writing JSON using Utf8JsonWriter #30755

@ahsonkhan

Description

@ahsonkhan

See dotnet/corefx#40792 (comment) for more context.

Currently, we have certain constants that we use to detect the token size against before starting to write the token.
https://github.com/dotnet/corefx/blob/70b4d01e18236c925c2d44d49fff7cbb4919dc43/src/System.Text.Json/src/System/Text/Json/JsonConstants.cs#L64-L67

These may not be necessary if we used checked arithmetic for figuring out the maximum size of the buffer needed for the output.

cc @stephentoub

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions