private void AppendTypeToBody(Message message, StringBuilder bodyBuilder) {
            Type type = message.GetType();
            string typeRef = this._typeResolver.CreateTypeRef(type);

            bodyBuilder.Append(IntegerToString(typeRef.Length));
            bodyBuilder.Append(typeRef);
        }
        internal MessageLogTraceRecord(ref Message message, XmlReader reader, MessageLoggingSource source, bool logMessageBody)
            : this(source)
        {
            Fx.Assert(message != null, "");

            MessageBuffer buffer = null;
            
            try
            {
                this.logMessageBody = logMessageBody;
                this.message = message;
                this.reader = reader;
                this.type = message.GetType();
            }
            finally
            {
                if (buffer != null)
                {
                    buffer.Close();
                }
            }
        }