Skip to content

Utf8JsonReader.ValueSequence Property

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: Utf8JsonReader.cs

ValueSequence()

Gets the value of the last processed token as a ReadOnlySpan slice of the input payload. If the JSON is provided within a ReadOnlySequence and the slice that represents the token value fits in a single segment, then ValueSpan will contain the sliced value since it can be represented as a span. Otherwise, the ValueSequence will contain the token value.

public ReadOnlySequence<byte> ValueSequence { get; set; }

Returns

ReadOnlySequence<byte>

Remarks

If HasValueSequence is false, ValueSequence contains useless data, likely for a previous multi-segment token. Therefore, only access ValueSequence if HasValueSequence is true. Otherwise, the token value must be accessed from ValueSpan.

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