private static String toBinaryString(BitSet bs, int nbits) {
        final StringBuilder buffer = new StringBuilder(bs.size());
        for (int i = nbits - 1; i >= 0; --i) {
            if (i < bs.size()) {
                buffer.append(bs.get(i) ? "1" : "0");
            } else {
                buffer.append("0");
            }
        }
        return buffer.toString();
    }
Initializes a new instance of the BitReader class with specified bytes buffer and start position in byte.

@param array Specify the byte array which contains the bytes need to be read.
@param index Specify the start position in byte.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/fsshttpb/util/BitReader.java