com.groupdocs.editor.htmlcss.resources.audio

Class Mp3Audio

    • Constructor Detail

      • Mp3Audio

        public Mp3Audio(String name,
                        InputStream binaryContent)

        Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name

        Parameters:
        name - Name of the MP3 content. Cannot be null, empty or whitespaces.
        binaryContent - Content as byte stream. Reading begins from original position. Cannot be null. Should be readable and seekable. If this instance will be disposed, this stream will be disposed too.
        Throws:
        IllegalArgumentException
    • Method Detail

      • dispose

        public final void dispose()

        Disposes this MP3 resource, disposing its content and making most methods and properties non-working

        Specified by:
        dispose in interface IDisposable
      • equals

        public final boolean equals(IHtmlResource other)

        Checks this instance with specified HTML resource on reference equality

        Parameters:
        other - Other inheritor of IHtmlResource interface
        Returns:
        True if are equal, false if are unequal
      • equals

        public final boolean equals(Mp3Audio other)

        Checks this instance with specified font resource on reference equality

        Parameters:
        other - Other instance of Mp3Audio class
        Returns:
        True if are equal, false if are unequal
      • getFilenameWithExtension

        public final String getFilenameWithExtension()

        Returns correct filename of this MP3 content, which consists of name and extension. Theoretically can differ from the name.

        Specified by:
        getFilenameWithExtension in interface IHtmlResource
        Returns:
      • getName

        public final String getName()

        Returns name of this MP3 content. Usually doesn't contain filename extension and theoretically can differ from filename.

        Specified by:
        getName in interface IHtmlResource
        Returns:
      • getTextContent

        public final String getTextContent()

        Returns content of this MP3 resource as base64-encoded string. This value is cached after first invoke.

        Specified by:
        getTextContent in interface IHtmlResource
      • isDisposed

        public final boolean isDisposed()

        Determines whether this MP3 content is disposed or not

        Specified by:
        isDisposed in interface IAuxDisposable
      • isValid

        public static boolean isValid(InputStream binaryContent)

        Checks whether specified stream is a valid MP3 content

        Parameters:
        binaryContent - Byte stream, that presumably contains a MP3 content
        Returns:
        True if specified stream contains valid MP3 content, false otherwise
      • save

        public final void save(String fullPathToFile)

        Saves this MP3 resource to the specified file

        Specified by:
        save in interface IHtmlResource
        Parameters:
        fullPathToFile - Full path to the file, which will be created or rewritten