@Override
    public int read() throws IOException {
        if (cacheBitsRemaining > 0) {
            throw new ImagingException("BitInputStream: incomplete bit read");
        }
        return in.read();
    }
Input stream that allows reading up to 32 bits across byte boundaries in most significant bit first order.
src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/BitInputStreamFlexible.java