Apache.NMS.ActiveMQ.OpenWire.BaseDataStreamMarshaller.TightMarshalBrokerError1 C# (CSharp) Method

TightMarshalBrokerError1() protected method

protected TightMarshalBrokerError1 ( OpenWireFormat wireFormat, Apache.NMS.ActiveMQ.Commands.BrokerError o, BooleanStream bs ) : int
wireFormat OpenWireFormat
o Apache.NMS.ActiveMQ.Commands.BrokerError
bs BooleanStream
return int
        protected int TightMarshalBrokerError1(OpenWireFormat wireFormat, BrokerError o, BooleanStream bs)
        {
            if (o == null)
            {
                bs.WriteBoolean(false);
                return 0;
            }
            else
            {
                int rc = 0;
                bs.WriteBoolean(true);
                rc += TightMarshalString1(o.ExceptionClass, bs);
                rc += TightMarshalString1(o.Message, bs);
                if (wireFormat.StackTraceEnabled)
                {
                    rc += 2;
                    StackTraceElement[] stackTrace = o.StackTraceElements;
                    for (int i = 0; i < stackTrace.Length; i++)
                    {
                        StackTraceElement element = stackTrace[i];
                        rc += TightMarshalString1(element.ClassName, bs);
                        rc += TightMarshalString1(element.MethodName, bs);
                        rc += TightMarshalString1(element.FileName, bs);
                        rc += 4;
                    }
                    rc += TightMarshalBrokerError1(wireFormat, o.Cause, bs);
                }

                return rc;
            }
        }