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

◆ Parse() [4/7]

static JsonDocument System.Text.Json.JsonDocument.Parse ( ReadOnlySequence< byte > utf8Json,
JsonDocumentOptions options = default(JsonDocumentOptions) )
inlinestatic

Definition at line 1085 of file JsonDocument.cs.

1086 {
1087 JsonReaderOptions readerOptions = options.GetReaderOptions();
1088 if (utf8Json.IsSingleSegment)
1089 {
1090 return Parse(utf8Json.First, readerOptions);
1091 }
1092 int num = checked((int)utf8Json.Length);
1093 byte[] array = ArrayPool<byte>.Shared.Rent(num);
1094 try
1095 {
1096 utf8Json.CopyTo(array.AsSpan());
1097 return Parse(array.AsMemory(0, num), readerOptions, array);
1098 }
1099 catch
1100 {
1101 array.AsSpan(0, num).Clear();
1103 throw;
1104 }
1105 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
static void Parse(ReadOnlySpan< byte > utf8JsonSpan, JsonReaderOptions readerOptions, ref MetadataDb database, ref StackRowStack stack)

References System.array, System.Text.Json.Dictionary, System.options, System.Text.Json.JsonDocument.Parse(), and System.Buffers.ArrayPool< T >.Shared.