Пример #1
0
        public static IBencodingType Decode(BinaryReader inputStream, ref int bytesConsumed)
        {
            IBencodingType returnValue = null;

            char next = (char)inputStream.PeekChar();

            switch (next)
            {
            case 'i':
                // Integer
                returnValue = new BInt(0);
                break;

            case 'l':
                // List
                returnValue = new BList();
                break;

            case 'd':
                // Dictionary
                returnValue = new BDict();
                break;

            case '0':
            case '1':
            case '2':
            case '3':
            case '4':
            case '5':
            case '6':
            case '7':
            case '8':
            case '9':
                // String
                returnValue = new BString();
                break;
            }

            return(returnValue.Decode(inputStream, ref bytesConsumed));
        }
Пример #2
0
        public bool Equals(BList obj)
        {
            IList <IBencodingType> other = obj;

            return(Equals(other));
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            BList other = obj as BList;

            return(Equals(other));
        }