public boolean readBit() throws IOException {
        switch (mNextBitIndex--) {
        case 0:
            boolean result = ((mNextByte & 1) != 0); 
            readAhead();
            return result;
        case 1: 
            return ((mNextByte & 2) != 0);
        case 2: 
            return ((mNextByte & 4) != 0);
        case 3: 
            return ((mNextByte & 8) != 0);
        case 4:
            return ((mNextByte & 16) != 0);
        case 5:
            return ((mNextByte & 32) != 0);
        case 6:
            return ((mNextByte & 64) != 0);
        case 7:
            return ((mNextByte & 128) != 0);
        default: 
            String msg 
                = "Index out of bounds. mNextBitIndex=" + mNextBitIndex;
            throw new IOException(msg);
        }
    }