Exemple #1
0
 public int GetHashCode(Object obj)
 {
     byte[] x = obj as byte[];
     if (null != x)
     {
         return(gethashcode(x, x.Length));
     }
     else
     {
         AppendBuffer abx = obj as AppendBuffer;
         if (null != abx)
         {
             return(gethashcode(abx.buf, abx.GetLength()));
         }
     }
     return(obj.GetHashCode());
 }
Exemple #2
0
        public int Compare(object ox, object oy)
        {
            byte[] x = ox as byte[];
            if (null != x)
            {
                byte[] y = (byte[])oy;
                return(cmp(x, x.Length, y, y.Length));
            }
            else
            {
                AppendBuffer abx = ox as AppendBuffer;
                if (null != x)
                {
                    AppendBuffer aby = oy as AppendBuffer;
                    return(cmp(abx.buf, abx.GetLength(), aby.buf, aby.GetLength()));
                }
            }

            return(-999); // ?
        }
Exemple #3
0
        public new bool Equals(object ox, object oy)
        {
            byte[] x = ox as byte[];
            if (null != x)
            {
                byte[] y = (byte[])oy;
                return(0 == cmp(x, x.Length, y, y.Length));
            }
            else
            {
                AppendBuffer abx = ox as AppendBuffer;
                if (null != x)
                {
                    AppendBuffer aby = oy as AppendBuffer;
                    return(0 == cmp(abx.buf, abx.GetLength(), aby.buf, aby.GetLength()));
                }
            }

            return(ox.Equals(oy));
        }