Exemplo n.º 1
0
        private static void SerializeStream <T>(T value, SerializationContext context)
        {
            using (var buffer = context.AsStream())
            {
                RuntimeTypeModel.Default.Serialize(buffer, value);
            }

            context.Complete();
        }
Exemplo n.º 2
0
        private static void Serialize(T value, SerializationContext context)
        {
            using (var buffer = context.AsStream())
            {
                Serializer.WriteObject(buffer, value);
            }

            context.Complete();
        }
Exemplo n.º 3
0
        private static void SerializeStream <T>(T value, SerializationContext context)
        {
            using (var stream = context.AsStream())
            {
                MessagePackSerializer.Serialize(stream, value);
            }

            context.Complete();
        }
        private static void Serialize(T value, SerializationContext context)
        {
            using (var buffer = context.AsStream())
            {
                var serializer = new DataContractSerializer(typeof(T));
                serializer.WriteObject(buffer, value);
            }

            context.Complete();
        }