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

GetBytes() public method

public GetBytes ( string key ) : byte[]
key string
return byte[]
        public byte[] GetBytes(string key)
        {
            Object value = GetObjectProperty(key);

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