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

◆ ReadNode< TValue >()

static TValue System.Text.Json.JsonSerializer.ReadNode< TValue > ( JsonNode node,
JsonTypeInfo jsonTypeInfo )
inlinestaticprivate

Definition at line 180 of file JsonSerializer.cs.

181 {
182 JsonSerializerOptions options = jsonTypeInfo.Options;
183 using PooledByteBufferWriter pooledByteBufferWriter = new PooledByteBufferWriter(options.DefaultBufferSize);
184 using (Utf8JsonWriter utf8JsonWriter = new Utf8JsonWriter(pooledByteBufferWriter, options.GetWriterOptions()))
185 {
186 if (node == null)
187 {
188 utf8JsonWriter.WriteNullValue();
189 }
190 else
191 {
192 node.WriteTo(utf8JsonWriter, options);
193 }
194 }
195 return ReadFromSpan<TValue>(pooledByteBufferWriter.WrittenMemory.Span, jsonTypeInfo);
196 }
static TValue ReadFromSpan< TValue >(ReadOnlySpan< byte > utf8Json, JsonTypeInfo jsonTypeInfo, int? actualByteCount=null)

References System.options, and System.Text.Json.JsonSerializer.ReadFromSpan< TValue >().

Referenced by System.Text.Json.JsonSerializer.Deserialize< TValue >(), and System.Text.Json.JsonSerializer.Deserialize< TValue >().