private static int readTotalRunLength(final BitInputStreamFlexible bitStream, final int color) throws ImagingException {
        int totalLength = 0;
        Integer runLength;
        do {
            if (color == WHITE) {
                runLength = WHITE_RUN_LENGTHS.decode(bitStream);
            } else {
                runLength = BLACK_RUN_LENGTHS.decode(bitStream);
            }
            totalLength += runLength;
        } while (runLength > 63);
        return totalLength;
    }
Decompress T.6 encoded data. No EOLs, except for 2 consecutive ones at the end (the EOFB, end of fax block). No RTC. No fill bits anywhere. All data is
2D encoded.

@param compressed compressed byte data
@param width      image width
@param height     image height
@return the decompressed data
@throws ImagingException if it fails to read the compressed data
src/main/java/org/apache/commons/imaging/formats/tiff/itu_t4/T4AndT6Compression.java