private Task SerializePublicId(PublicId arg, Stream dest, CustomJsonSerializer serializer) { serializer.SerializeString(arg.ToString(), dest); return(Task.CompletedTask); }
private Task SerializeChar(char arg, Stream dest, CustomJsonSerializer serializer) { SerializeString(arg.ToString(), dest); return(Task.CompletedTask); }
private Task SerializeBool(bool arg, Stream dest, CustomJsonSerializer serializer) { dest.Write(System.Text.Encoding.UTF8.GetBytes(arg ? "true" : "false")); return(Task.CompletedTask); }
private Task SerializeDouble(double arg, Stream dest, CustomJsonSerializer serializer) { dest.Write(System.Text.Encoding.UTF8.GetBytes(arg.ToString())); return(Task.CompletedTask); }
private async Task SerializeCollection(CollectionObject collection, Stream dest, CustomJsonSerializer serializer) { if (collection.IsBaseObjectDefined) { await SerializeObject(collection, dest); } else if (collection.items != null) { await SerializeArray(collection.items, dest); } else { await SerializeNull(dest); } }