23 writes to ValueSpan
System.Text.Json (23)
System\Text\Json\Reader\Utf8JsonReader.cs (14)
241ValueSpan = ReadOnlySpan<byte>.Empty; 746ValueSpan = _buffer.Slice(_consumed, 1); 768ValueSpan = _buffer.Slice(_consumed, 1); 780ValueSpan = _buffer.Slice(_consumed, 1); 802ValueSpan = _buffer.Slice(_consumed, 1); 818ValueSpan = default; 966ValueSpan = _buffer.Slice(_consumed, 1); 976ValueSpan = _buffer.Slice(_consumed, 1); 1144ValueSpan = span.Slice(0, literal.Length); 1299ValueSpan = localBuffer.Slice(0, idx); 1398ValueSpan = data.Slice(0, idx); 1533ValueSpan = data.Slice(0, i); 2529ValueSpan = _buffer.Slice(previousConsumed + 2, idx); 2547ValueSpan = _buffer.Slice(previousConsumed + 2, idx);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (9)
50ValueSpan = ReadOnlySpan<byte>.Empty; 125ValueSpan = default; 341ValueSpan = _buffer.Slice(_consumed, 1); 351ValueSpan = _buffer.Slice(_consumed, 1); 529ValueSpan = span.Slice(0, literal.Length); 764ValueSpan = localBuffer.Slice(0, idx); 1093ValueSpan = data.Slice(0, idx); 1244ValueSpan = data.Slice(0, i); 2204ValueSpan = commentSequence.First.Span;
58 references to ValueSpan
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Protocol\JsonHubProtocol.cs (1)
204target = binder.GetTarget(reader.ValueSpan) ?? reader.GetString();
System.Text.Json (57)
System\Text\Json\Document\JsonDocument.cs (5)
994database.Append(tokenType, tokenStart, reader.ValueSpan.Length); 1041database.Append(tokenType, tokenStart, reader.ValueSpan.Length); 1057database.Append(tokenType, tokenStart + 1, reader.ValueSpan.Length); 1082database.Append(tokenType, tokenStart + 1, reader.ValueSpan.Length); 1091database.Append(tokenType, tokenStart, reader.ValueSpan.Length);
System\Text\Json\Document\JsonDocument.Parse.cs (5)
526valueSpan = reader.ValueSpan; 543valueSpan = reader.ValueSpan; 558int payloadLength = reader.ValueSpan.Length + 2; 583payloadLength += reader.ValueSpan.Length; 604byte displayByte = reader.ValueSpan[0];
System\Text\Json\JsonHelpers.cs (1)
24ReadOnlySpan<byte> span = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan;
System\Text\Json\Reader\Utf8JsonReader.cs (11)
55internal readonly int ValueLength => HasValueSequence ? checked((int)ValueSequence.Length) : ValueSpan.Length; 63/// <see cref="ValueSpan"/> will contain the sliced value since it can be represented as a span. 67/// If <see cref="HasValueSequence"/> is true, <see cref="ValueSpan"/> contains useless data, likely for 68/// a previous single-segment token. Therefore, only access <see cref="ValueSpan"/> if <see cref="HasValueSequence"/> is false. 136/// Lets the caller know whether the current <see cref="ValueSpan" /> or <see cref="ValueSequence"/> properties 152/// <see cref="ValueSpan"/> will contain the sliced value since it can be represented as a span. 158/// Otherwise, the token value must be accessed from <see cref="ValueSpan"/>. 501return otherUtf8Text.SequenceEqual(ValueSpan); 613ReadOnlySpan<byte> localSpan = ValueSpan; 703int sourceLength = ValueSpan.Length; 2582ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan;
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (27)
39ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 59/// An appropriately sized buffer can be determined by consulting the length of either <see cref="ValueSpan"/> or <see cref="ValueSequence"/>, 104ReadOnlySpan<byte> valueSpan = ValueSpan; 123/// An appropriately sized buffer can be determined by consulting the length of either <see cref="ValueSpan"/> or <see cref="ValueSequence"/>, 180unescapedSource = ValueSpan; 217source = ValueSpan; 245ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 271Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); 834ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 862ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 898ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 933ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 968ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1003ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1039ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1075ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1111ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1146ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1176ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1206ReadOnlySpan<byte> span = HasValueSequence ? ValueSequence.ToArray() : ValueSpan; 1263if (!JsonHelpers.IsInRangeInclusive(ValueSpan.Length, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1269span = ValueSpan; 1328if (!JsonHelpers.IsInRangeInclusive(ValueSpan.Length, JsonConstants.MinimumDateTimeParseLength, JsonConstants.MaximumEscapedDateTimeOffsetParseLength)) 1334span = ValueSpan; 1394if (ValueSpan.Length > JsonConstants.MaximumEscapedGuidLength) 1400span = ValueSpan;
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (1)
41source = reader.ValueSpan;
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (1)
45source = reader.ValueSpan;
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (1)
45source = reader.ValueSpan;
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (4)
403valueSpan = reader.ValueSpan; 416int payloadLength = reader.ValueSpan.Length + 2; 435: reader.ValueSpan.Length + 2; 452: reader.ValueSpan[0];
System\Text\Json\ThrowHelper.Serialization.cs (1)
756state.Current.JsonPropertyName = reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan.ToArray();