System\Text\Json\Reader\Utf8JsonReader.cs (103)
540int length = checked(text.Length * JsonConstants.MaxExpansionFactorWhileTranscoding);
542if (length > JsonConstants.StackallocByteThreshold)
549otherUtf8Text = stackalloc byte[JsonConstants.StackallocByteThreshold];
615if (localSpan.Length < other.Length || localSpan.Length / JsonConstants.MaxExpansionFactorWhileEscaping > other.Length)
620int idx = localSpan.IndexOf(JsonConstants.BackSlash);
641if (sequenceLength < other.Length || sequenceLength / JsonConstants.MaxExpansionFactorWhileEscaping > other.Length)
654int idx = span.IndexOf(JsonConstants.BackSlash);
719|| sourceLength / (ValueIsEscaped ? JsonConstants.MaxExpansionFactorWhileEscaping : JsonConstants.MaxExpansionFactorWhileTranscoding) > charTextLength)
732|| sourceLength / (ValueIsEscaped ? JsonConstants.MaxExpansionFactorWhileEscaping : JsonConstants.MaxExpansionFactorWhileTranscoding) > charTextLength)
756ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.MismatchedObjectArray, JsonConstants.CloseBrace);
790ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.MismatchedObjectArray, JsonConstants.CloseBracket);
832if (first <= JsonConstants.Space)
849if (first == JsonConstants.Slash)
857if (first == JsonConstants.CloseBrace)
863if (first != JsonConstants.Quote)
885if (first == JsonConstants.CloseBracket)
962if (first == JsonConstants.OpenBrace)
972else if (first == JsonConstants.OpenBracket)
1050if (val is not JsonConstants.Space and
1051not JsonConstants.CarriageReturn and
1052not JsonConstants.LineFeed and
1053not JsonConstants.Tab)
1058if (val == JsonConstants.LineFeed)
1079Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment);
1082if (marker == JsonConstants.Quote)
1086else if (marker == JsonConstants.OpenBrace)
1090else if (marker == JsonConstants.OpenBracket)
1100return ConsumeLiteral(JsonConstants.FalseValue, JsonTokenType.False);
1104return ConsumeLiteral(JsonConstants.TrueValue, JsonTokenType.True);
1108return ConsumeLiteral(JsonConstants.NullValue, JsonTokenType.Null);
1117if (marker == JsonConstants.Slash)
1124if (marker == JsonConstants.Slash)
1140if (marker <= JsonConstants.Space)
1266JsonConstants.Delimiters.Contains(_buffer[_consumed]))
1291if (first <= JsonConstants.Space)
1302if (first != JsonConstants.KeyValueSeparator)
1316Debug.Assert(_buffer[_consumed] == JsonConstants.Quote);
1330if (foundByte == JsonConstants.Quote)
1361Debug.Assert(data[idx] != JsonConstants.Quote);
1362Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space);
1373if (currentByte == JsonConstants.Quote)
1381else if (currentByte == JsonConstants.BackSlash)
1387int index = JsonConstants.EscapableChars.IndexOf(currentByte);
1411else if (currentByte < JsonConstants.Space)
1607if (JsonConstants.Delimiters.Contains(nextByte))
1663if (JsonConstants.Delimiters.Contains(nextByte))
1763if (marker == JsonConstants.Slash)
1789if (marker == JsonConstants.ListSeparator)
1807if (first <= JsonConstants.Space)
1820if (_readerOptions.CommentHandling == JsonCommentHandling.Allow && first == JsonConstants.Slash)
1828if (first != JsonConstants.Quote)
1830if (first == JsonConstants.CloseBrace)
1845if (first == JsonConstants.CloseBracket)
1857else if (marker == JsonConstants.CloseBrace)
1861else if (marker == JsonConstants.CloseBracket)
1896if (first <= JsonConstants.Space)
1916Debug.Assert(first != JsonConstants.Slash);
1920if (first == JsonConstants.ListSeparator)
1944if (first <= JsonConstants.Space)
1957if (first == JsonConstants.Slash)
1972if (first != JsonConstants.Quote)
1974if (first == JsonConstants.CloseBrace)
1997if (first == JsonConstants.CloseBracket)
2017else if (first == JsonConstants.CloseBrace)
2021else if (first == JsonConstants.CloseBracket)
2038Debug.Assert(first != JsonConstants.CloseBrace);
2039if (first != JsonConstants.Quote)
2060Debug.Assert(first != JsonConstants.CloseBracket);
2080Debug.Assert(first != JsonConstants.CloseBrace);
2081if (first != JsonConstants.Quote)
2097Debug.Assert(first != JsonConstants.CloseBracket);
2119while (marker == JsonConstants.Slash)
2131if (marker <= JsonConstants.Space)
2154while (marker == JsonConstants.Slash)
2167if (marker <= JsonConstants.Space)
2200if (marker == JsonConstants.CloseBrace)
2206if (marker != JsonConstants.Quote)
2228if (marker == JsonConstants.CloseBracket)
2258else if (marker == JsonConstants.ListSeparator)
2276if (marker <= JsonConstants.Space)
2296if (marker != JsonConstants.Quote)
2298if (marker == JsonConstants.CloseBrace)
2314if (marker == JsonConstants.CloseBracket)
2327else if (marker == JsonConstants.CloseBrace)
2331else if (marker == JsonConstants.CloseBracket)
2356if (marker == JsonConstants.Slash)
2360else if (marker == JsonConstants.Asterisk)
2366ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2372ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2384if (localBuffer[idx] == JsonConstants.LineFeed)
2390Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
2394if (localBuffer[idx + 1] == JsonConstants.LineFeed)
2441int idx = localBuffer.IndexOfAny(JsonConstants.LineFeed, JsonConstants.CarriageReturn, JsonConstants.StartingByteOfNonStandardSeparator);
2450if (localBuffer[idx] != JsonConstants.StartingByteOfNonStandardSeparator)
2486int foundIdx = localBuffer.Slice(idx).IndexOf(JsonConstants.Slash);
2495if (foundIdx != 0 && localBuffer[foundIdx + idx - 1] == JsonConstants.Asterisk)
2533if (marker == JsonConstants.Slash)
2537else if (marker == JsonConstants.Asterisk)