Utf8JsonReader.ValueSequence Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the raw value of the last processed token as a ReadOnlySequence<byte> slice of the input payload, only if the token is contained within multiple segments.
public:
property System::Buffers::ReadOnlySequence<System::Byte> ValueSequence { System::Buffers::ReadOnlySequence<System::Byte> get(); };
public System.Buffers.ReadOnlySequence<byte> ValueSequence { get; }
member this.ValueSequence : System.Buffers.ReadOnlySequence<byte>
Public ReadOnly Property ValueSequence As ReadOnlySequence(Of Byte)
Property Value
A byte read-only sequence.
Remarks
If the JSON is provided within a ReadOnlySequence<byte> and the slice that represents the token value fits in a single segment, then ValueSpan contains the sliced value since it can be represented as a span. Otherwise, ValueSequence
contains the token value.
If HasValueSequence is false
, ValueSequence
is empty.
Therefore, only access ValueSequence
if HasValueSequence is true
.
Otherwise, the token value must be accessed from ValueSpan.
There is no guarantee that this property will always contain well-formed data. If the input JSON passed in to the Utf8JsonReader
contains invalid UTF-8 bytes within JSON string tokens, this property will return back those invalid UTF-8 bytes as is.
Therefore, if the input is untrusted or not previously validated, call GetString() to get the JSON string token.
Since this property returns the raw bytes, avoid using it for text comparison. Instead call ValueTextEquals, which unescapes the text if necessary.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기