@Override
        void shift() throws IOException {
            int bit = (int) (low >>> (STATE_SIZE - 1));
            outputStream.write(bit);

            // Write out saved underflow bits
            while (underFlowCount > 0) {
                outputStream.write(bit ^ 0x01);
                underFlowCount--;
            }
        }
The total of the frequencies of the specified symbol and all the ones below.
indexr-segment/src/main/java/io/indexr/compress/ArthmeticCoder.java