private void handleEmbedded(String name, String type, byte[] contents,
                                EmbeddedDocumentExtractor embeddedExtractor, ContentHandler handler)
            throws IOException, SAXException, TikaException {
        Metadata metadata = new Metadata();
        if (name != null) {
            metadata.set(TikaCoreProperties.RESOURCE_NAME_KEY, name);
        }
        if (type != null) {
            metadata.set(Metadata.CONTENT_TYPE, type);
        }

        if (embeddedExtractor.shouldParseEmbedded(metadata)) {
            embeddedExtractor.parseEmbedded(TikaInputStream.get(contents),
                    new EmbeddedContentHandler(handler), metadata, true);
        }
    }
Extracts properties and text from an MS Document input stream
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/TNEFParser.java