private bool?DecodeInitialLength() { if (this.extraBits > 0) { int bits = this.input.GetBits(this.extraBits); if (bits < 0) { return(new bool?(false)); } if (this.blockLength < 0 || this.blockLength >= DeflateDecompressor.lengthBase.Length) { DeflateDecompressor.ThrowInvalidData(); } this.blockLength = DeflateDecompressor.lengthBase[this.blockLength] + bits; } this.state = DeflateDecompressor.DecompressorState.HaveFullLength; return(new bool?()); }
private void DecodeDistance(ref int nextSymbol) { nextSymbol -= 257; if (nextSymbol < 8) { nextSymbol += 3; this.extraBits = 0; } else if (nextSymbol != 28) { if (nextSymbol < 0 || nextSymbol >= Tree.ExtraLengthBits.Length) { DeflateDecompressor.ThrowInvalidData(); } this.extraBits = Tree.ExtraLengthBits[nextSymbol]; } else { nextSymbol = 258; this.extraBits = 0; } this.blockLength = nextSymbol; }