SerializeToStream() public method

public SerializeToStream ( object value, Stream stream ) : void
value object
stream Stream
return void
 public void SerializeToStream_Works()
 {
     var ser = new MessagePackSerializer();
     var stream = new MemoryStream();
     ser.SerializeToStream(new []{"test1"},stream);
     Assert.Greater(stream.Length,0);
 }
        /// <summary>
        /// Initializes and register serializers
        /// </summary>
        /// <param name="appHost">The app host object to register with.</param>
        public static void Register(IAppHost appHost)
        {
            var serializer = new MessagePackSerializer();

            appHost.ContentTypeFilters.Register(ContentType,
                (requestContext, response, stream) => serializer.SerializeToStream(response, stream),
                serializer.DeserializeFromStream);
        }
        /// <summary>
        /// Initializes and register serializers
        /// </summary>
        /// <param name="appHost">The app host object to register with.</param>
        public static void Register(IAppHost appHost)
        {
            var serializer = new MessagePackSerializer();

            appHost.ContentTypeFilters.Register(ContentType,
                                                (requestContext, response, stream) => serializer.SerializeToStream(response, stream),
                                                serializer.DeserializeFromStream);
        }