示例#1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            BEncodedString other;

            if (obj is string)
            {
                other = new BEncodedString((string)obj);
            }
            else if (obj is BEncodedString)
            {
                other = (BEncodedString)obj;
            }
            else
            {
                return(false);
            }

            return(InfoHash.compare_array <byte>(this.textBytes, other.textBytes));
        }