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

◆ DeserializeAsyncEnumerable< TValue >()

static IAsyncEnumerable< TValue?> System.Text.Json.JsonSerializer.DeserializeAsyncEnumerable< TValue > ( Stream utf8Json,
JsonSerializerOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken) )
inlinestatic

Definition at line 940 of file JsonSerializer.cs.

941 {
942 if (utf8Json == null)
943 {
944 throw new ArgumentNullException("utf8Json");
945 }
946 if (options == null)
947 {
948 options = JsonSerializerOptions.s_defaultOptions;
949 }
950 if (!options.IsInitializedForReflectionSerializer)
951 {
952 options.InitializeForReflectionSerializer();
953 }
955 [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
957 {
958 ReadBufferState bufferState = new ReadBufferState(options.DefaultBufferSize);
961 ReadStack readStack = default(ReadStack);
963 JsonReaderState jsonReaderState = new JsonReaderState(options.GetReaderOptions());
964 try
965 {
966 do
967 {
970 object returnValue = readStack.Current.ReturnValue;
972 {
973 while (queue.Count > 0)
974 {
975 yield return queue.Dequeue();
976 }
977 }
978 }
979 while (!bufferState.IsFinalBlock);
980 }
981 finally
982 {
983 bufferState.Dispose();
984 }
985 }
986 }
static JsonTypeInfo CreateQueueJsonTypeInfo< TValue >(JsonConverter queueConverter, JsonSerializerOptions queueOptions)
static async ValueTask< ReadBufferState > ReadFromStreamAsync(Stream utf8Json, ReadBufferState bufferState, CancellationToken cancellationToken)

References System.cancellationToken, System.converter, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Text.Json.JsonSerializer.CreateQueueJsonTypeInfo< TValue >(), System.Text.Json.Dictionary, System.Collections.Generic.Dictionary< TKey, TValue >.Initialize(), System.options, System.Text.Json.JsonSerializer.ReadFromStreamAsync(), and System.Text.Json.JsonSerializerOptions.s_defaultOptions.