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)
1387if (!JsonConstants.EscapableChars.Contains(currentByte))
1410else if (currentByte < JsonConstants.Space)
1606if (JsonConstants.Delimiters.Contains(nextByte))
1662if (JsonConstants.Delimiters.Contains(nextByte))
1762if (marker == JsonConstants.Slash)
1788if (marker == JsonConstants.ListSeparator)
1806if (first <= JsonConstants.Space)
1819if (_readerOptions.CommentHandling == JsonCommentHandling.Allow && first == JsonConstants.Slash)
1827if (first != JsonConstants.Quote)
1829if (first == JsonConstants.CloseBrace)
1844if (first == JsonConstants.CloseBracket)
1856else if (marker == JsonConstants.CloseBrace)
1860else if (marker == JsonConstants.CloseBracket)
1895if (first <= JsonConstants.Space)
1915Debug.Assert(first != JsonConstants.Slash);
1919if (first == JsonConstants.ListSeparator)
1943if (first <= JsonConstants.Space)
1956if (first == JsonConstants.Slash)
1971if (first != JsonConstants.Quote)
1973if (first == JsonConstants.CloseBrace)
1996if (first == JsonConstants.CloseBracket)
2016else if (first == JsonConstants.CloseBrace)
2020else if (first == JsonConstants.CloseBracket)
2037Debug.Assert(first != JsonConstants.CloseBrace);
2038if (first != JsonConstants.Quote)
2059Debug.Assert(first != JsonConstants.CloseBracket);
2079Debug.Assert(first != JsonConstants.CloseBrace);
2080if (first != JsonConstants.Quote)
2096Debug.Assert(first != JsonConstants.CloseBracket);
2118while (marker == JsonConstants.Slash)
2130if (marker <= JsonConstants.Space)
2153while (marker == JsonConstants.Slash)
2166if (marker <= JsonConstants.Space)
2199if (marker == JsonConstants.CloseBrace)
2205if (marker != JsonConstants.Quote)
2227if (marker == JsonConstants.CloseBracket)
2257else if (marker == JsonConstants.ListSeparator)
2275if (marker <= JsonConstants.Space)
2295if (marker != JsonConstants.Quote)
2297if (marker == JsonConstants.CloseBrace)
2313if (marker == JsonConstants.CloseBracket)
2326else if (marker == JsonConstants.CloseBrace)
2330else if (marker == JsonConstants.CloseBracket)
2355if (marker == JsonConstants.Slash)
2359else if (marker == JsonConstants.Asterisk)
2365ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2371ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2383if (localBuffer[idx] == JsonConstants.LineFeed)
2389Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
2393if (localBuffer[idx + 1] == JsonConstants.LineFeed)
2440int idx = localBuffer.IndexOfAny(JsonConstants.LineFeed, JsonConstants.CarriageReturn, JsonConstants.StartingByteOfNonStandardSeparator);
2449if (localBuffer[idx] != JsonConstants.StartingByteOfNonStandardSeparator)
2485int foundIdx = localBuffer.Slice(idx).IndexOf(JsonConstants.Slash);
2494if (foundIdx != 0 && localBuffer[foundIdx + idx - 1] == JsonConstants.Asterisk)
2532if (marker == JsonConstants.Slash)
2536else if (marker == JsonConstants.Asterisk)