Esempio n. 1
0
        private void SetPreviousCode()
        {
            byte num1 = 0;
            int  num2;

            if (this.lengthCode == 16)
            {
                if (this.loopCounter == 0)
                {
                    DeflateDecompressor.ThrowInvalidDataGeneric();
                }
                num1 = this.codeList[this.loopCounter - 1];
                num2 = this.input.GetBits(2) + 3;
            }
            else
            {
                num2 = this.lengthCode == 17 ? this.input.GetBits(3) + 3 : this.input.GetBits(7) + 11;
            }
            if (this.loopCounter + num2 > this.codeArraySize)
            {
                DeflateDecompressor.ThrowInvalidDataGeneric();
            }
            for (int index = 0; index < num2; ++index)
            {
                this.codeList[this.loopCounter++] = num1;
            }
        }
Esempio n. 2
0
 private void SetTreeCodes()
 {
     byte[] codeLengths1 = new byte[288];
     byte[] codeLengths2 = new byte[32];
     Array.Copy((Array)this.codeList, (Array)codeLengths1, this.literalLengthCodeCount);
     Array.Copy((Array)this.codeList, this.literalLengthCodeCount, (Array)codeLengths2, 0, this.distanceCodeCount);
     if (codeLengths1[256] == (byte)0)
     {
         DeflateDecompressor.ThrowInvalidDataGeneric();
     }
     this.literalLengthTree = new InflateTree(codeLengths1);
     this.distanceTree      = new InflateTree(codeLengths2);
 }