Apache.NMS.Util.PrimitiveMapInterceptor.GetByte C# (CSharp) Method

GetByte() public method

public GetByte ( string key ) : byte
key string
return byte
        public byte GetByte(string key)
        {
            Object value = GetObjectProperty(key);

            try
            {
                if(value is Byte)
                {
                    return (byte) value;
                }
                else if(value is String)
                {
                    return Convert.ToByte(value);
                }
                else
                {
                    throw new MessageFormatException(" cannot read a byte from " + value.GetType().Name);
                }
            }
            catch(FormatException ex)
            {
                throw NMSExceptionSupport.CreateMessageFormatException(ex);
            }
        }