static void RemoveBits(ref int bitBuffer, ref int bitCount, int bits) { bitBuffer >>= bits; bitCount -= bits; }