MessageToBytes() публичный Метод

Runs the interceptor on the input and returns the output as a byte array. Used to serialize a message stream.
public MessageToBytes ( byte input ) : MessageInterceptorResult
input byte The input.
Результат MessageInterceptorResult
        private void TestGzipNoCompression(string body, int length)
        {
            var configuration = new GZipMessageInterceptorConfiguration {MiniumSize = length};
            var gzip = new GZipMessageInterceptor(configuration);

            var serialization = gzip.MessageToBytes(Encoding.UTF8.GetBytes(body));
            Assert.Equal(false, serialization.AddToGraph);
            Assert.Equal(body, Encoding.UTF8.GetString(serialization.Output));
        }
        private void TestGzip(string body)
        {
            var configuration = new GZipMessageInterceptorConfiguration();
            var gzip = new GZipMessageInterceptor(configuration);

            var serialization = gzip.MessageToBytes(Encoding.UTF8.GetBytes(body));
            if (serialization.AddToGraph)
            {
                var actual = Encoding.UTF8.GetString(gzip.BytesToMessage(serialization.Output));
                Assert.Equal(body, actual);
            }
            else
            {
                Assert.Equal(body, Encoding.UTF8.GetString(serialization.Output));
            }
        }