private static async ValueTask <object> DeserializeObjectAsync <T>(Stream stream, MessagePackSerializerOptions options, CancellationToken cancellationToken) => await DeserializeAsync <T>(stream, options, cancellationToken);
 public MessagePackContentSerializer()
 {
     _options = MsgPack.MessagePackSerializerOptions.Standard;
 }
 /// <seealso cref="DeserializeAsync{T}(Stream, MessagePackSerializerOptions, CancellationToken)"/>
 public static ValueTask <object> DeserializeAsync(Type type, Stream stream, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default)
 {
     return(GetOrAdd(type).DeserializeAsync_Stream_Options_CancellationToken.Invoke(stream, options, cancellationToken));
 }
 /// <seealso cref="Deserialize{T}(ReadOnlyMemory{byte}, MessagePackSerializerOptions)"/>
 public static object Deserialize(Type type, ReadOnlyMemory <byte> bytes, MessagePackSerializerOptions options = null)
 {
     return(GetOrAdd(type).Deserialize_ReadOnlyMemory_Options.Invoke(bytes, options));
 }
 /// <seealso cref="Deserialize{T}(ref MessagePackReader, MessagePackSerializerOptions)"/>
 public static object Deserialize(Type type, ref MessagePackReader reader, MessagePackSerializerOptions options = null)
 {
     return(GetOrAdd(type).Deserialize_MessagePackReader_Options.Invoke(ref reader, options));
 }
 /// <seealso cref="Deserialize{T}(Stream, MessagePackSerializerOptions)"/>
 public static object Deserialize(Type type, Stream stream, MessagePackSerializerOptions options = null)
 {
     return(GetOrAdd(type).Deserialize_Stream_Options.Invoke(stream, options));
 }
 /// <seealso cref="Serialize{T}(Stream, T, MessagePackSerializerOptions)"/>
 public static void Serialize(Type type, Stream stream, object obj, MessagePackSerializerOptions options = null)
 {
     GetOrAdd(type).Serialize_Stream_T_Options.Invoke(stream, obj, options);
 }
 /// <seealso cref="Serialize{T}(T, MessagePackSerializerOptions)"/>
 public static byte[] Serialize(Type type, object obj, MessagePackSerializerOptions options = null)
 {
     return(GetOrAdd(type).Serialize_T_Options.Invoke(obj, options));
 }
 /// <seealso cref="Serialize{T}(ref MessagePackWriter, T, MessagePackSerializerOptions)"/>
 public static void Serialize(Type type, ref MessagePackWriter writer, object obj, MessagePackSerializerOptions options = null)
 {
     GetOrAdd(type).Serialize_MessagePackWriter_T_Options.Invoke(ref writer, obj, options);
 }
Esempio n. 10
0
 /// <summary>
 /// Convert a message-pack binary to a JSON string.
 /// </summary>
 public static string ConvertToJson(ReadOnlyMemory <byte> bytes, MessagePackSerializerOptions options = null, CancellationToken cancellationToken = default) => ConvertToJson(new ReadOnlySequence <byte>(bytes), options, cancellationToken);
 /// <summary>
 /// Convert a message-pack binary to a JSON string.
 /// </summary>
 public static string ConvertToJson(ReadOnlyMemory <byte> bytes, MessagePackSerializerOptions options = null) => ConvertToJson(new ReadOnlySequence <byte>(bytes), options);