public int readBit() throws IOException {
        int retVal;
        // 当前mBytePos指向字节已经读完
        if(mBitPos == 8){

            if (isEnd && mBytePos == mEndBytePos){
                // 到达数据流的末端
                throw new EOFException();
            }
            // 缓冲区的数据完全读取完了
            if(mBytePos == mByteBuf.length-1){
                // 载入下一段数据到缓冲区中
                int byteRead = mIs.read(mByteBuf);
                if (byteRead != mByteBuf.length){
                    if (byteRead == -1){
                        throw new EOFException();
                    }
                    mEndBytePos = byteRead-1;
                    isEnd = true;
                }
                mBitPos = mBytePos = 0;
            }else{
                // 指向缓冲区中下一字节
                ++mBytePos;
                mBitPos = 0;
            }

            // 得到一位
            return readBit();
        }else{
            retVal = mByteBuf[mBytePos] >>> (7-mBitPos);
            ++mBitPos;
            return retVal & 0x1;
        }
    }