Esempio n. 1
0
        /// <summary>
        /// Decode the next token as a list.
        /// Assumes the next token is a list.
        /// </summary>
        /// <param name="inputStream"></param>
        /// <param name="bytesConsumed"></param>
        /// <returns>Decoded list</returns>
        public static BList Decode(BinaryReader inputStream, ref int bytesConsumed)
        {
            // Get past 'l'
            inputStream.Read();
            bytesConsumed++;

            BList res = new BList();

            // Read elements till an 'e'
            while (inputStream.PeekChar() != 'e')
            {
                res.Add(BencodingUtils.Decode(inputStream, ref bytesConsumed));
            }

            // Get past 'e'
            inputStream.Read();
            bytesConsumed++;

            return(res);
        }
Esempio n. 2
0
        public bool Equals(BList obj)
        {
            IList <IBencodingType> other = obj;

            return(Equals(other));
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            BList other = obj as BList;

            return(Equals(other));
        }