Apache.NMS.ActiveMQ.Commands.ActiveMQMapMessage.BeforeMarshall C# (CSharp) Method

BeforeMarshall() public method

public BeforeMarshall ( OpenWireFormat wireFormat ) : void
wireFormat Apache.NMS.ActiveMQ.OpenWire.OpenWireFormat
return void
        public override void BeforeMarshall(OpenWireFormat wireFormat)
        {
            if(body == null)
            {
                Content = null;
            }
            else
            {
                MemoryStream buffer = new MemoryStream();
                Stream target = buffer;

                if(this.Connection != null && this.Connection.UseCompression)
                {
                    target = this.Connection.CompressionPolicy.CreateCompressionStream(target);
                    this.Compressed = true;
                }

                this.body.Marshal(target);
                target.Close();

                this.Content = buffer.ToArray();
            }

            Tracer.Debug("BeforeMarshalling, content is: " + Content);

            base.BeforeMarshall(wireFormat);
        }