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

LooseUnmarshalBrokerError() protected method

protected LooseUnmarshalBrokerError ( OpenWireFormat wireFormat, BinaryReader dataIn ) : Apache.NMS.ActiveMQ.Commands.BrokerError
wireFormat OpenWireFormat
dataIn System.IO.BinaryReader
return Apache.NMS.ActiveMQ.Commands.BrokerError
        protected virtual BrokerError LooseUnmarshalBrokerError(
            OpenWireFormat wireFormat,
            BinaryReader dataIn)
        {
            if (dataIn.ReadBoolean())
            {
                BrokerError answer = new BrokerError();

                answer.ExceptionClass = LooseUnmarshalString(dataIn);
                answer.Message = LooseUnmarshalString(dataIn);
                if (wireFormat.StackTraceEnabled)
                {
                    short length = dataIn.ReadInt16();
                    StackTraceElement[] stackTrace = new StackTraceElement[length];
                    for (int i = 0; i < stackTrace.Length; i++)
                    {
                        StackTraceElement element = new StackTraceElement();
                        element.ClassName = LooseUnmarshalString(dataIn);
                        element.MethodName = LooseUnmarshalString(dataIn);
                        element.FileName = LooseUnmarshalString(dataIn);
                        element.LineNumber = dataIn.ReadInt32();
                        stackTrace[i] = element;
                    }
                    answer.StackTraceElements = stackTrace;
                    answer.Cause = LooseUnmarshalBrokerError(wireFormat, dataIn);
                }
                return answer;
            }
            else
            {
                return null;
            }
        }