FixedJsonValueDocument<T>.ForStringFromSpan Method
Definition
Namespace: Corvus.Text.Json.Internal
Assembly: Corvus.Text.Json.dll
Overloads
| Method | Description |
|---|---|
| ForStringFromSpan(ReadOnlySpan<byte>) | Creates a FixedJsonValueDocument for a string value from a span, copying the data into the document's internal buffer (zero heap... |
| ForStringFromSpan(ReadOnlySpan<char>) | Creates a FixedJsonValueDocument for a string value from a char span. The input is the pre-quoted, pre-escaped JSON string repre... |
ForStringFromSpan(ReadOnlySpan<byte>)
Source: FixedJsonValueDocument.cs
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
A pooled document instance wrapping the string value.
Applies To
| Product | Versions |
|---|---|
| .NET | 9, 10 |
| .NET Standard | 2.0, 2.1 |
ForStringFromSpan(ReadOnlySpan<char>)
Source: FixedJsonValueDocument.cs
Creates a FixedJsonValueDocument for a string value from a char span. The input is the pre-quoted, pre-escaped JSON string representation (e.g., "hello" or "line\nbreak").
public static FixedJsonValueDocument<T> ForStringFromSpan(ReadOnlySpan<char> rawQuotedChars)
Parameters
| Name | Type | Description |
|---|---|---|
rawQuotedChars |
ReadOnlySpan<char> |
The quoted, escaped JSON string as chars (including surrounding double-quotes). |
Returns
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