public uint TryLoad16Bits() {
if (this.bitsInBuffer < 8) {
if (this.start < this.end) {
this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
this.bitsInBuffer += 8;
}
if (this.start < this.end) {
this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
this.bitsInBuffer += 8;
}
}
else if ((this.bitsInBuffer < 0x10) && (this.start < this.end)) {
this.bitBuffer |= (uint)(this.buffer[this.start++] << this.bitsInBuffer);
this.bitsInBuffer += 8;
}
return this.bitBuffer;
}
public int GetNextSymbol(InputBuffer input) { uint num = input.TryLoad16Bits(); if (input.AvailableBits == 0) { return(-1); } int index = this.table[(num & this.tableMask)]; if (index < 0) { uint num3 = ((uint)1) << this.tableBits; do { index = -index; if ((num & num3) == 0) { index = this.left[index]; } else { index = this.right[index]; } num3 = num3 << 1; }while (index < 0); } if (this.codeLengthArray[index] > input.AvailableBits) { return(-1); } input.SkipBits(this.codeLengthArray[index]); return(index); }