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(); }
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); }
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); }