Ejemplo n.º 1
0
 private static T DeserializeStream <T>(DeserializationContext context)
 {
     using (var buffer = context.AsStream())
     {
         return((T)RuntimeTypeModel.Default.Deserialize(buffer, null, typeof(T)));
     }
 }
Ejemplo n.º 2
0
 private static T DeserializeStream <T>(DeserializationContext context)
 {
     using (var stream = context.AsStream())
     {
         return(MessagePackSerializer.Deserialize <T>(stream));
     }
 }
Ejemplo n.º 3
0
 internal static T Deserialize <T>(DeserializationContext context, RuntimeTypeModel runtimeTypeModel)
 {
     using (var buffer = context.AsStream())
     {
         return((T)runtimeTypeModel.Deserialize(buffer, null, typeof(T)));
     }
 }
Ejemplo n.º 4
0
 private static T Deserialize(DeserializationContext context)
 {
     using (var buffer = context.AsStream())
     {
         return((T)Serializer.ReadObject(buffer));
     }
 }
 private static T Deserialize(DeserializationContext context)
 {
     using (var buffer = context.AsStream())
     {
         var serializer = new DataContractSerializer(typeof(T));
         return((T)serializer.ReadObject(buffer));
     }
 }