/// <summary>
        /// Factor method to create a message from a byte list
        /// </summary>
        /// <param name="messageBytes">A byte list from which the message will be decoded</param>
        /// <returns>A new message of the right specialization</returns>
        public static new StatusReply Create(ByteList messageBytes)
        {
            StatusReply result = null;

            if (messageBytes==null || messageBytes.RemainingToRead<MinimumEncodingLength)
                throw new ApplicationException("Invalid message byte array");
            if (messageBytes.PeekInt16() != ClassId)
                throw new ApplicationException("Invalid message class id");
            else
            {
                result = new StatusReply();
                result.Decode(messageBytes);
            }

            return result;
        }
示例#2
0
        /// <summary>
        /// Factor method to create a message from a byte list
        /// </summary>
        /// <param name="messageBytes">A byte list from which the message will be decoded</param>
        /// <returns>A new message of the right specialization</returns>
        new public static StatusReply Create(ByteList messageBytes)
        {
            StatusReply result = null;

            if (messageBytes == null || messageBytes.RemainingToRead < MinimumEncodingLength)
            {
                throw new ApplicationException("Invalid message byte array");
            }
            if (messageBytes.PeekInt16() != ClassId)
            {
                throw new ApplicationException("Invalid message class id");
            }
            else
            {
                result = new StatusReply();
                result.Decode(messageBytes);
            }

            return(result);
        }