protected override void OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer) { byte[] bytes = new byte[this.stream.Length]; this.stream.Position = 0; this.stream.Read(bytes, 0, bytes.Length); writer.WriteRaw(this.encoding.GetString(bytes)); } }