Ejemplo n.º 1
0
        private ValueDictionary ParseBEncodeDict(MemoryStream responseStream)
        {
            ValueDictionary dictionary1 = null;

            if ((this.ContentEncoding == "gzip") || (this.ContentEncoding == "x-gzip"))
            {
                var stream1 = new GZipStream(responseStream, CompressionMode.Decompress);
                try
                {
                    return((ValueDictionary)BEncode.Parse(stream1));
                }
                catch (Exception)
                {
                }
            }
            try
            {
                dictionary1 = (ValueDictionary)BEncode.Parse(responseStream);
            }
            catch (Exception exception1)
            {
                Console.Write(exception1.StackTrace);
            }
            return(dictionary1);
        }
        private ValueDictionary parseBEncodeDict(MemoryStream responseStream)
        {
            ValueDictionary dictionary = null;

            if ((this._contentEncoding == "gzip") || (this._contentEncoding == "x-gzip"))
            {
                GZipStream d = new GZipStream(responseStream, CompressionMode.Decompress);
                try
                {
                    dictionary = (ValueDictionary)BEncode.Parse(d);
                }
                catch (Exception)
                {
                }
                return(dictionary);
            }
            try
            {
                dictionary = (ValueDictionary)BEncode.Parse(responseStream);
            }
            catch (Exception exception)
            {
                Console.Write(exception.StackTrace);
            }
            return(dictionary);
        }