Esempio n. 1
0
 private void SetLiteralProperties(int lp, int lc)
 {
     if (lp > 8 || lc > 8)
     {
         LzmaDecompressor.InvalidLzmaProperties();
     }
     this.literalDecoder = new LzmaLiteralDecoder(lp, lc);
 }
Esempio n. 2
0
        private void SetPosBitsProperties(int pb)
        {
            if (pb > 4)
            {
                LzmaDecompressor.InvalidLzmaProperties();
            }
            uint positionStates = (uint)(1 << pb);

            this.lengthDecoder         = new LzmaLengthDecoder(positionStates);
            this.repeaterLengthDecoder = new LzmaLengthDecoder(positionStates);
            this.positionStateMask     = positionStates - 1U;
        }
Esempio n. 3
0
        private void InitializeDecompressor(int propertiesIndex)
        {
            byte[] buffer = this.Header.Buffer;
            int    lc     = (int)buffer[propertiesIndex] % 9;
            int    num    = (int)buffer[propertiesIndex] / 9;
            int    lp     = num % 5;
            int    pb     = num / 5;

            if (pb > 4)
            {
                LzmaDecompressor.InvalidLzmaProperties();
            }
            uint size = 0;

            ++propertiesIndex;
            for (int index = 0; index < 4; ++index)
            {
                size += (uint)buffer[propertiesIndex + index] << index * 8;
            }
            this.SetDictionarySize(size);
            this.SetLiteralProperties(lp, lc);
            this.SetPosBitsProperties(pb);
        }