private static long convertFromBytes(byte[] buffer, int startIndex, int bytesToConvert) {
        long ret = 0;
        int bitCount = 0;
        for (int i = 0; i < bytesToConvert; i++) {
            UByte ubyte = Unsigned.ubyte(buffer[startIndex + i]);
            ret |= ubyte.longValue() << bitCount;

            bitCount += 8;
        }

        return ret;
    }
Returns a value built from the specified number of bytes from the given buffer,
starting at index.

@param buffer         Specify the data in byte array format
@param startIndex     Specify the first index to use
@param bytesToConvert Specify the number of bytes to use
@return Return the value built from the given bytes
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/onenote/fsshttpb/util/LittleEndianBitConverter.java