Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ WriteStartEscapeProperty() [2/2]

void System.Text.Json.Utf8JsonWriter.WriteStartEscapeProperty ( ReadOnlySpan< char > propertyName,
byte token,
int firstEscapeIndexProp )
inlineprivate

Definition at line 442 of file Utf8JsonWriter.cs.

443 {
444 char[] array = null;
445 int maxEscapedLength = JsonWriterHelper.GetMaxEscapedLength(propertyName.Length, firstEscapeIndexProp);
446 Span<char> span = ((maxEscapedLength > 128) ? ((Span<char>)(array = ArrayPool<char>.Shared.Rent(maxEscapedLength))) : stackalloc char[128]);
447 Span<char> destination = span;
448 JsonWriterHelper.EscapeString(propertyName, destination, firstEscapeIndexProp, _options.Encoder, out var written);
449 WriteStartByOptions(destination.Slice(0, written), token);
450 if (array != null)
451 {
453 }
454 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
void WriteStartByOptions(ReadOnlySpan< byte > utf8PropertyName, byte token)

References System.Text.Json.Utf8JsonWriter._options, System.array, System.destination, System.Text.Json.Dictionary, System.Text.Json.JsonWriterOptions.Encoder, System.Text.Json.JsonWriterHelper.EscapeString(), System.Text.Json.JsonWriterHelper.GetMaxEscapedLength(), System.Buffers.ArrayPool< T >.Shared, and System.Text.Json.Utf8JsonWriter.WriteStartByOptions().