array_equals() static private method

static private array_equals ( byte foo, byte bar ) : bool
foo byte
bar byte
return bool
Beispiel #1
0
        public override void remove(String host, String type, byte[] key)
        {
            bool _sync = false;

            for (int i = 0; i < pool.Count; i++)
            {
                var hk = (HostKey)(pool[i]);
                if (host == null ||
                    (hk.getHost().Equals(host) &&
                     (type == null || (hk.getType().Equals(type) &&
                                       (key == null || Util.array_equals(key, hk.key))))))
                {
                    pool.Remove(hk);
                    _sync = true;
                }
            }
            if (_sync)
            {
                try
                {
                    sync();
                }
                catch
                {
                }
                ;
            }
        }
Beispiel #2
0
        public override int check(String host, byte[] key)
        {
            //String foo;
            //byte[] bar;
            HostKey hk;
            int     result = NOT_INCLUDED;
            int     type   = getType(key);

            for (int i = 0; i < pool.Count; i++)
            {
                hk = (HostKey)(pool[i]);
                if (isIncluded(hk.host, host) && hk.type == type)
                {
                    if (Util.array_equals(hk.key, key))
                    {
                        //System.out.println("find!!");
                        return(OK);
                    }
                    else
                    {
                        result = CHANGED;
                    }
                }
            }
            //System.out.println("fail!!");
            return(result);
        }