public int decodeBit(short[] probs, int index) throws IOException {
        int prob = probs[index];
        int newBound = (Range >>> kNumBitModelTotalBits) * prob;
        if ((Code ^ 0x80000000) < (newBound ^ 0x80000000)) {
            Range = newBound;
            probs[index] = (short) (prob + ((kBitModelTotal - prob) >>> kNumMoveBits));
            if ((Range & kTopMask) == 0) {
                Code = (Code << 8) | Stream.read();
                Range <<= 8;
            }
            return 0;
        } else {
            Range -= newBound;
            Code -= newBound;
            probs[index] = (short) (prob - ((prob) >>> kNumMoveBits));
            if ((Range & kTopMask) == 0) {
                Code = (Code << 8) | Stream.read();
                Range <<= 8;
            }
            return 1;
        }
    }