// private methods
        private byte[] CreateMessageBytes(CommandMessage message)
        {
            var stream          = new MemoryStream();
            var encoderSettings = new MessageEncoderSettings();
            var encoder         = new CommandMessageBinaryEncoder(stream, encoderSettings);

            encoder.WriteMessage(message);
            return(stream.ToArray());
        }
        /// <summary>
        /// Writes the message.
        /// </summary>
        /// <param name="message">The message.</param>
        public void WriteMessage(CommandRequestMessage message)
        {
            var wrappedMessage = message.WrappedMessage;

            _wrappedEncoder.WriteMessage(wrappedMessage);
        }