Skip to content

FixedJsonValueDocument<T>.ForStringFromSpan Method

Definition

Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Source: FixedJsonValueDocument.cs

ForStringFromSpan(ReadOnlySpan<byte>)

Creates a FixedJsonValueDocument for a string value from a span, copying the data into the document's internal buffer (zero heap allocation).

public static FixedJsonValueDocument<T> ForStringFromSpan(ReadOnlySpan<byte> rawQuotedUtf8String)

Parameters

Name Type Description
rawQuotedUtf8String ReadOnlySpan<byte> The raw UTF-8 string bytes (including surrounding quotes). Must be <= 64 bytes.

Returns

FixedJsonValueDocument<T>

A pooled document instance wrapping the string value.

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue