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)
1016if (val is not JsonConstants.Space and
1017not JsonConstants.CarriageReturn and
1018not JsonConstants.LineFeed and
1019not JsonConstants.Tab)
1024if (val == JsonConstants.LineFeed)
1045Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment);
1048if (marker == JsonConstants.Quote)
1052else if (marker == JsonConstants.OpenBrace)
1056else if (marker == JsonConstants.OpenBracket)
1066return ConsumeLiteral(JsonConstants.FalseValue, JsonTokenType.False);
1070return ConsumeLiteral(JsonConstants.TrueValue, JsonTokenType.True);
1074return ConsumeLiteral(JsonConstants.NullValue, JsonTokenType.Null);
1083if (marker == JsonConstants.Slash)
1090if (marker == JsonConstants.Slash)
1106if (marker <= JsonConstants.Space)
1232JsonConstants.Delimiters.IndexOf(_buffer[_consumed]) >= 0)
1257if (first <= JsonConstants.Space)
1268if (first != JsonConstants.KeyValueSeparator)
1282Debug.Assert(_buffer[_consumed] == JsonConstants.Quote);
1296if (foundByte == JsonConstants.Quote)
1327Debug.Assert(data[idx] != JsonConstants.Quote);
1328Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space);
1339if (currentByte == JsonConstants.Quote)
1347else if (currentByte == JsonConstants.BackSlash)
1353int index = JsonConstants.EscapableChars.IndexOf(currentByte);
1377else if (currentByte < JsonConstants.Space)
1573if (JsonConstants.Delimiters.IndexOf(nextByte) >= 0)
1629if (JsonConstants.Delimiters.IndexOf(nextByte) >= 0)
1729if (marker == JsonConstants.Slash)
1755if (marker == JsonConstants.ListSeparator)
1773if (first <= JsonConstants.Space)
1786if (_readerOptions.CommentHandling == JsonCommentHandling.Allow && first == JsonConstants.Slash)
1794if (first != JsonConstants.Quote)
1796if (first == JsonConstants.CloseBrace)
1811if (first == JsonConstants.CloseBracket)
1823else if (marker == JsonConstants.CloseBrace)
1827else if (marker == JsonConstants.CloseBracket)
1862if (first <= JsonConstants.Space)
1882Debug.Assert(first != JsonConstants.Slash);
1886if (first == JsonConstants.ListSeparator)
1910if (first <= JsonConstants.Space)
1923if (first == JsonConstants.Slash)
1938if (first != JsonConstants.Quote)
1940if (first == JsonConstants.CloseBrace)
1963if (first == JsonConstants.CloseBracket)
1983else if (first == JsonConstants.CloseBrace)
1987else if (first == JsonConstants.CloseBracket)
2004Debug.Assert(first != JsonConstants.CloseBrace);
2005if (first != JsonConstants.Quote)
2026Debug.Assert(first != JsonConstants.CloseBracket);
2046Debug.Assert(first != JsonConstants.CloseBrace);
2047if (first != JsonConstants.Quote)
2063Debug.Assert(first != JsonConstants.CloseBracket);
2085while (marker == JsonConstants.Slash)
2097if (marker <= JsonConstants.Space)
2120while (marker == JsonConstants.Slash)
2133if (marker <= JsonConstants.Space)
2166if (marker == JsonConstants.CloseBrace)
2172if (marker != JsonConstants.Quote)
2194if (marker == JsonConstants.CloseBracket)
2224else if (marker == JsonConstants.ListSeparator)
2242if (marker <= JsonConstants.Space)
2262if (marker != JsonConstants.Quote)
2264if (marker == JsonConstants.CloseBrace)
2280if (marker == JsonConstants.CloseBracket)
2293else if (marker == JsonConstants.CloseBrace)
2297else if (marker == JsonConstants.CloseBracket)
2322if (marker == JsonConstants.Slash)
2326else if (marker == JsonConstants.Asterisk)
2332ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2338ThrowHelper.ThrowJsonReaderException(ref this, ExceptionResource.ExpectedStartOfValueNotFound, JsonConstants.Slash);
2350if (localBuffer[idx] == JsonConstants.LineFeed)
2356Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
2360if (localBuffer[idx + 1] == JsonConstants.LineFeed)
2407int idx = localBuffer.IndexOfAny(JsonConstants.LineFeed, JsonConstants.CarriageReturn, JsonConstants.StartingByteOfNonStandardSeparator);
2416if (localBuffer[idx] != JsonConstants.StartingByteOfNonStandardSeparator)
2452int foundIdx = localBuffer.Slice(idx).IndexOf(JsonConstants.Slash);
2461if (foundIdx != 0 && localBuffer[foundIdx + idx - 1] == JsonConstants.Asterisk)
2499if (marker == JsonConstants.Slash)
2503else if (marker == JsonConstants.Asterisk)