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

◆ ReadFromSpan< TValue >() [2/2]

static TValue System.Text.Json.JsonSerializer.ReadFromSpan< TValue > ( ReadOnlySpan< char > json,
JsonTypeInfo jsonTypeInfo )
inlinestaticprivate

Definition at line 1235 of file JsonSerializer.cs.

1236 {
1237 byte[] array = null;
1238 Span<byte> span = (((long)json.Length > 349525L) ? new byte[JsonReaderHelper.GetUtf8ByteCount(json)] : (array = ArrayPool<byte>.Shared.Rent(json.Length * 3)));
1239 try
1240 {
1241 int utf8FromText = JsonReaderHelper.GetUtf8FromText(json, span);
1242 span = span.Slice(0, utf8FromText);
1244 }
1245 finally
1246 {
1247 if (array != null)
1248 {
1249 span.Clear();
1250 ArrayPool<byte>.Shared.Return(array);
1251 }
1252 }
1253 }
static TValue ReadFromSpan< TValue >(ReadOnlySpan< byte > utf8Json, JsonTypeInfo jsonTypeInfo, int? actualByteCount=null)

References System.array, System.Collections.Generic.Dictionary< TKey, TValue >.Clear(), System.Text.Json.JsonReaderHelper.GetUtf8ByteCount(), System.Text.Json.JsonReaderHelper.GetUtf8FromText(), System.L, and System.Text.Json.JsonSerializer.ReadFromSpan< TValue >().