public byte[] GetBytes(string key) { Object value = GetValue(key); if(value != null && !(value is Byte[])) { throw new NMSException("Property: " + key + " is not an byte[] but is: " + value); } return (byte[]) value; }