private Thread logStream(final InputStream stream, final ContentHandler handler,
                             final AtomicInteger totalBytes) {
        return new Thread(() -> {
            Reader reader = new InputStreamReader(stream, UTF_8);
            char[] buffer = new char[1024];
            try {
                for (int n = reader.read(buffer); n != -1; n = reader.read(buffer)) {
                    handler.characters(buffer, 0, n);
                    totalBytes.addAndGet(n);
                }
            } catch (SAXException | IOException e) {
                //swallow
            } finally {
                IOUtils.closeQuietly(stream);
            }
        });
    }
Runs the "strings" command on the given file.

@param input  {@see File} object that represents the file to parse.
@param config {@see StringsConfig} object including the strings
              configuration.
@param xhtml  {@see XHTMLContentHandler} object.
@return the total number of bytes read using the strings command.
@throws IOException   if any I/O error occurs.
@throws TikaException if the parsing process has been interrupted.
@throws SAXException
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-text-module/src/main/java/org/apache/tika/parser/strings/StringsParser.java