private void extractHOCROutput(InputStream is, ParseContext parseContext, ContentHandler xhtml)
            throws TikaException, IOException, SAXException {
        if (parseContext == null) {
            parseContext = new ParseContext();
        }

//        <div class="ocr"
        AttributesImpl attrs = new AttributesImpl();
        attrs.addAttribute("", "class", "class", "CDATA", "ocr");
        xhtml.startElement(XHTML, "div", "div", attrs);
        XMLReaderUtils.parseSAX(is, new HOCRPassThroughHandler(xhtml),
                parseContext);
        xhtml.endElement(XHTML, "div", "div");

    }
Reads the contents of the given stream and write it to the given XHTML
content handler. The stream is closed once fully processed.

@param stream Stream where is the result of ocr
@param xhtml  XHTML content handler
@throws SAXException if the XHTML SAX events could not be handled
@throws IOException  if an input error occurred
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-ocr-module/src/main/java/org/apache/tika/parser/ocr/TesseractOCRParser.java