Class MagicNumber

    • Constructor Detail

      • MagicNumber

        public MagicNumber​(javax.activation.MimeType mimeType,
                           javax.activation.MimeType... hostMimeTypes)
        Constructor.
        Parameters:
        mimeType - is the MIME type associated to this magic number.
        hostMimeTypes - are the MIME types given by the low-level analyzer and associated to this number.
      • MagicNumber

        public MagicNumber​(javax.activation.MimeType mimeType,
                           String formatVersion,
                           javax.activation.MimeType... hostMimeTypes)
        Constructor.
        Parameters:
        mimeType - is the MIME type associated to this magic number.
        formatVersion - is a string representing the format version supported by this magic number.
        hostMimeTypes - are the MIME types given by the low-level analyzer and associated to this number.
      • MagicNumber

        public MagicNumber​(MimeName mimeType,
                           MimeName... hostMimeTypes)
        Constructor.
        Parameters:
        mimeType - is the MIME type associated to this magic number.
        hostMimeTypes - are the MIME types given by the low-level analyzer and associated to this number.
        Throws:
        IllegalArgumentException - if one of the MIME types cannot be parsed.
      • MagicNumber

        public MagicNumber​(MimeName mimeType,
                           String formatVersion,
                           MimeName... hostMimeTypes)
        Constructor.
        Parameters:
        mimeType - is the MIME type associated to this magic number.
        formatVersion - is a string representing the format version supported by this magic number.
        hostMimeTypes - are the MIME types given by the low-level analyzer and associated to this number.
        Throws:
        IllegalArgumentException - if one of the MIME types cannot be parsed.
    • Method Detail

      • getHostMimeTypes

        @Pure
        javax.activation.MimeType[] getHostMimeTypes()
        Replies the MIME type used by the Java virtal machine for this magic number.
        Returns:
        the low-level MIME type.
      • getMimeType

        @Pure
        public javax.activation.MimeType getMimeType()
        Replies the MIME type for this magic number.
        Returns:
        the MIME type.
      • getFormatVersion

        @Pure
        public String getFormatVersion()
        Replies the format version for this magic number.
        Returns:
        the format version or null.
      • isContentType

        @Pure
        protected abstract boolean isContentType​(MagicNumberStream stream)
        Replies if the specified stream contains data that corresponds to this magic number.
        Parameters:
        stream - is the stream to analyse.
        Returns:
        true if the stream is containing this magic number, otherwise false