src/main/java/org/jcodec/common/io/DummyBitstreamReader.java
public int readNBit(int n) throws IOException {
        if (n > 32)
            throw new IllegalArgumentException("Can not read more then 32 bit");

        int val = 0;

        for (int i = 0; i < n; i++) {
            val <<= 1;
            val |= read1BitInt();
        }

        return val;
    }
public int readNBit(int n) throws IOException {
        if (n > 32)
            throw new IllegalArgumentException("Can not read more then 32 bit");

        int val = 0;

        for (int i = 0; i < n; i++) {
            val <<= 1;
            val |= read1BitInt();
        }

        return val;
    }
/*
(non-Javadoc)

@see ua.org.jplayer.javcodec.h264.RBSPInputStream#readNBit(int)