@Override
    public void parse(InputStream stream, ContentHandler handler, Metadata metadata,
                      ParseContext context) throws IOException, SAXException, TikaException {

        //Try to parse TSD file
        try (RereadableInputStream ris = new RereadableInputStream(stream, 2048, true)) {
            Metadata TSDAndEmbeddedMetadata = new Metadata();

            List<TSDMetas> tsdMetasList = this.extractMetas(ris);
            this.buildMetas(tsdMetasList,
                    metadata != null && metadata.size() > 0 ? TSDAndEmbeddedMetadata : metadata);

            XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
            xhtml.startDocument();
            ris.rewind();

            //Try to parse embedded file in TSD file
            this.parseTSDContent(ris, xhtml, TSDAndEmbeddedMetadata, context);
            xhtml.endDocument();
        }
    }
Tika parser for Time Stamped Data Envelope (application/timestamped-data)
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-crypto-module/src/main/java/org/apache/tika/parser/crypto/TSDParser.java