public void process(InputStream input, OutputStream output, Metadata metadata) throws Exception {
            Parser p = parser;
            if (fork) {
                p = new ForkParser(TikaCLI.class.getClassLoader(), p);
            }
            ContentHandler handler = getContentHandler(output, metadata);
            try {
                p.parse(input, handler, metadata, context);
                // fix for TIKA-596: if a parser doesn't generate
                // XHTML output, the lack of an output document prevents
                // metadata from being output: this fixes that
                if (handler instanceof NoDocumentMetHandler) {
                    NoDocumentMetHandler metHandler = (NoDocumentMetHandler) handler;
                    if (!metHandler.metOutput()) {
                        metHandler.endDocument();
                    }
                }
            } finally {
                if (fork) {
                    ((ForkParser) p).close();
                }
            }
        }
Outputs the Tika metadata as XMP using the Tika XMP module
tika-app/src/main/java/org/apache/tika/cli/TikaCLI.java