public MediaType detect(InputStream input, Metadata metadata) {
        // Look for a type hint in the input metadata
        String hint = metadata.get(Metadata.CONTENT_TYPE);
        if (hint != null) {
            MediaType type = MediaType.parse(hint);
            if (type != null) {
                return type;
            }
        }
        return MediaType.OCTET_STREAM;
    }
Detects the content type of an input document based on a type hint
given in the input metadata. The CONTENT_TYPE attribute of the given
input metadata is expected to contain the type of the input document.
If that attribute exists and contains a valid type name, then that
type is returned.

@param input    ignored
@param metadata input metadata, possibly with a CONTENT_TYPE value
@return detected media type, or <code>application/octet-stream</code>
tika-core/src/main/java/org/apache/tika/detect/TypeDetector.java