Ejemplo n.º 1
0
 public DeflateDecompressor(DeflateSettings settings)
     : base(settings)
 {
     this.output   = new OutputWindow();
     this.input    = new InputBitsBuffer();
     this.codeList = new byte[320];
     this.codeLengthTreeCodeLength = new byte[19];
     this.Reset();
 }
Ejemplo n.º 2
0
        public int GetBits(int count)
        {
            if (!this.CheckAvailable(count))
            {
                return(-1);
            }
            int num = (int)this.bitBuffer & (int)InputBitsBuffer.GetBitMask(count);

            this.bitBuffer    >>= count;
            this.availableBits -= count;
            return(num);
        }
Ejemplo n.º 3
0
        public int ReadInput(InputBitsBuffer input, int length)
        {
            int length1 = 32768 - this.end;

            length = Math.Min(Math.Min(length, this.FreeBytes), input.AvailableBytes);
            int num;

            if (length <= length1)
            {
                num = input.Read(this.window, this.end, length);
            }
            else
            {
                num = input.Read(this.window, this.end, length1);
                if (num == length1)
                {
                    num += input.Read(this.window, 0, length - length1);
                }
            }
            this.end             = this.end + num & (int)short.MaxValue;
            this.availableBytes += num;
            return(num);
        }