/// <summary> /// Writes the message body contents to the specified writer. /// </summary> /// <param name="writer">The <see cref="XmlDictionaryWriter"/> that is used to /// write the message body contents.</param> protected override void OnWriteBodyContents(XmlDictionaryWriter writer) { using (XmlDictionaryReader reader = this.OnGetReaderAtBodyContents()) { PoxBinaryBufferedMessage.WriteContents(reader, writer); } }
/// <summary> /// Converts the message body to a string. /// </summary> /// <param name="writer">The writer to which the message is written.</param> protected override void OnBodyToString(XmlDictionaryWriter writer) { using (XmlDictionaryReader reader = this._data.TakeReader()) { PoxBinaryBufferedMessage.WriteContents(reader, writer); } }
/// <summary> /// Returns an identical copy of the original message from which this buffer was /// created. /// </summary> /// <returns>A copy of the original message.</returns> /// <exception cref="ObjectDisposedException" /> public override Message CreateMessage() { lock (this.ThisLock) { if (this.isClosed) { throw PoxBinaryBufferedMessageBuffer.CreateBufferDisposedException(); } PoxBinaryBufferedMessage destinationMessage = new PoxBinaryBufferedMessage(this._data); destinationMessage.Headers.CopyHeadersFrom(this._headers); destinationMessage.Properties.CopyProperties(this._properties); return(destinationMessage); } }