SmartAssembly.Zip.SimpleZip.Inflater.DecodeHuffman C# (CSharp) Method

DecodeHuffman() private method

private DecodeHuffman ( ) : bool
return bool
            private bool DecodeHuffman()
            {
                int freeSpace = this.outputWindow.GetFreeSpace();
                while (freeSpace >= 0x102)
                {
                    int num2;
                    switch (this.mode)
                    {
                        case 7:
                            goto Label_0051;

                        case 8:
                            goto Label_00B7;

                        case 9:
                            goto Label_0106;

                        case 10:
                            goto Label_0138;

                        default:
                        {
                            continue;
                        }
                    }
                Label_0037:
                    this.outputWindow.Write(num2);
                    if (--freeSpace < 0x102)
                    {
                        return true;
                    }
                Label_0051:
                    if (((num2 = this.litlenTree.GetSymbol(this.input)) & -256) == 0)
                    {
                        goto Label_0037;
                    }
                    if (num2 < 0x101)
                    {
                        if (num2 < 0)
                        {
                            return false;
                        }
                        this.distTree = null;
                        this.litlenTree = null;
                        this.mode = 2;
                        return true;
                    }
                    this.repLength = CPLENS[num2 - 0x101];
                    this.neededBits = CPLEXT[num2 - 0x101];
                Label_00B7:
                    if (this.neededBits > 0)
                    {
                        this.mode = 8;
                        int num3 = this.input.PeekBits(this.neededBits);
                        if (num3 < 0)
                        {
                            return false;
                        }
                        this.input.DropBits(this.neededBits);
                        this.repLength += num3;
                    }
                    this.mode = 9;
                Label_0106:
                    num2 = this.distTree.GetSymbol(this.input);
                    if (num2 < 0)
                    {
                        return false;
                    }
                    this.repDist = CPDIST[num2];
                    this.neededBits = CPDEXT[num2];
                Label_0138:
                    if (this.neededBits > 0)
                    {
                        this.mode = 10;
                        int num4 = this.input.PeekBits(this.neededBits);
                        if (num4 < 0)
                        {
                            return false;
                        }
                        this.input.DropBits(this.neededBits);
                        this.repDist += num4;
                    }
                    this.outputWindow.Repeat(this.repLength, this.repDist);
                    freeSpace -= this.repLength;
                    this.mode = 7;
                }
                return true;
            }