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

◆ WriteStringEscapePropertyOrValue() [1/4]

unsafe void System.Text.Json.Utf8JsonWriter.WriteStringEscapePropertyOrValue ( ReadOnlySpan< byte > utf8PropertyName,
ReadOnlySpan< byte > utf8Value,
int firstEscapeIndexProp,
int firstEscapeIndexVal )
inlineprivate

Definition at line 3505 of file Utf8JsonWriter.cs.

3506 {
3507 byte[] array = null;
3508 byte[] array2 = null;
3509 if (firstEscapeIndexVal != -1)
3510 {
3511 int maxEscapedLength = JsonWriterHelper.GetMaxEscapedLength(utf8Value.Length, firstEscapeIndexVal);
3512 Span<byte> destination;
3513 if (maxEscapedLength > 256)
3514 {
3517 }
3518 else
3519 {
3520 byte* pointer = stackalloc byte[256];
3521 destination = new Span<byte>(pointer, 256);
3522 }
3523 JsonWriterHelper.EscapeString(utf8Value, destination, firstEscapeIndexVal, _options.Encoder, out var written);
3524 utf8Value = destination.Slice(0, written);
3525 }
3526 if (firstEscapeIndexProp != -1)
3527 {
3528 int maxEscapedLength2 = JsonWriterHelper.GetMaxEscapedLength(utf8PropertyName.Length, firstEscapeIndexProp);
3529 Span<byte> destination2;
3530 if (maxEscapedLength2 > 256)
3531 {
3534 }
3535 else
3536 {
3537 byte* pointer2 = stackalloc byte[256];
3538 destination2 = new Span<byte>(pointer2, 256);
3539 }
3542 }
3544 if (array != null)
3545 {
3547 }
3548 if (array2 != null)
3549 {
3551 }
3552 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
void WriteStringByOptions(ReadOnlySpan< char > propertyName, DateTime value)

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.pointer, System.Buffers.ArrayPool< T >.Shared, and System.Text.Json.Utf8JsonWriter.WriteStringByOptions().