84 references to MaxExpansionFactorWhileTranscoding
System.Text.Json (84)
System\Text\Json\Document\JsonDocument.cs (1)
314
int length = checked(otherText.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
);
System\Text\Json\JsonConstants.cs (1)
76
public const int MaxUtf16RawValueLength = int.MaxValue /
MaxExpansionFactorWhileTranscoding
;
System\Text\Json\Reader\Utf8JsonReader.cs (3)
540
int length = checked(text.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
);
719
|| sourceLength / (ValueIsEscaped ? JsonConstants.MaxExpansionFactorWhileEscaping : JsonConstants.
MaxExpansionFactorWhileTranscoding
) > charTextLength)
732
|| sourceLength / (ValueIsEscaped ? JsonConstants.MaxExpansionFactorWhileEscaping : JsonConstants.
MaxExpansionFactorWhileTranscoding
) > charTextLength)
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (6)
434
json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? stackalloc byte[JsonConstants.StackallocByteThreshold] :
436
json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) :
465
json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? stackalloc byte[JsonConstants.StackallocByteThreshold] :
467
json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) :
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (4)
213
Debug.Assert(escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
< int.MaxValue - encodedLength - 6);
217
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + encodedLength + 6;
287
Debug.Assert(escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
< int.MaxValue - indent - encodedLength - 7 - _newLineLength);
291
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + encodedLength + 7 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (4)
218
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6);
222
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDateTimeOffsetLength + 6;
289
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength);
293
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDateTimeOffsetLength + 7 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (4)
217
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6);
221
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDateTimeOffsetLength + 6;
288
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength);
292
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDateTimeOffsetLength + 7 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (4)
217
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatDecimalLength - 4);
221
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDecimalLength + 4;
282
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength);
286
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDecimalLength + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (4)
221
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatDoubleLength - 4);
225
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDoubleLength + 4;
286
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength);
290
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatDoubleLength + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (4)
221
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatSingleLength - 4);
225
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatSingleLength + 4;
286
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength);
290
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatSingleLength + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (4)
217
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatGuidLength - 6);
221
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatGuidLength + 6;
290
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength);
294
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatGuidLength + 7 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (4)
141
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - 5);
145
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 5;
172
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - 6 - _newLineLength);
176
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 6 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (4)
340
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - value.Length - 4);
344
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + value.Length + 4;
433
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - value.Length - 5 - _newLineLength);
437
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + value.Length + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (4)
293
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatInt64Length - 4);
297
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatInt64Length + 4;
358
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength);
362
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatInt64Length + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (16)
162
Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.
MaxExpansionFactorWhileTranscoding
);
166
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 4;
193
Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.
MaxExpansionFactorWhileTranscoding
);
197
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 5 + _newLineLength;
1373
Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length);
1377
int maxRequired = ((escapedPropertyName.Length + escapedValue.Length) * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 6;
1444
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length - 6);
1448
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + escapedValue.Length + 6;
1480
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length - 6);
1484
int maxRequired = (escapedValue.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + escapedPropertyName.Length + 6;
1519
Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length);
1523
int maxRequired = indent + ((escapedPropertyName.Length + escapedValue.Length) * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 7 + _newLineLength;
1620
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length - 7 - indent - _newLineLength);
1624
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + escapedValue.Length + 7 + _newLineLength;
1671
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - escapedValue.Length - 7 - indent - _newLineLength);
1675
int maxRequired = indent + (escapedValue.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + escapedPropertyName.Length + 7 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (4)
302
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - JsonConstants.MaximumFormatUInt64Length - 4);
306
int maxRequired = (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatUInt64Length + 4;
367
Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength);
371
int maxRequired = indent + (escapedPropertyName.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + JsonConstants.MaximumFormatUInt64Length + 5 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (4)
83
Debug.Assert(value.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - 4);
87
int maxRequired = (value.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 4;
117
Debug.Assert(value.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - 4 - _newLineLength);
121
int maxRequired = indent + (value.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 4 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (3)
208
json.Length <= (JsonConstants.StackallocByteThreshold / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? stackalloc byte[JsonConstants.StackallocByteThreshold] :
210
json.Length <= (JsonConstants.ArrayPoolMaxSizeBeforeUsingNormalAlloc / JsonConstants.
MaxExpansionFactorWhileTranscoding
) ? tempArray = ArrayPool<byte>.Shared.Rent(json.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) :
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (4)
118
Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - 3);
122
int maxRequired = (escapedValue.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 3;
148
Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
) - indent - 3 - _newLineLength);
152
int maxRequired = indent + (escapedValue.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
) + 3 + _newLineLength;
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (2)
177
Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.
MaxExpansionFactorWhileTranscoding
));
179
int requiredBytes = escapedValue.Length * JsonConstants.
MaxExpansionFactorWhileTranscoding
;