public final class Mp3Audio extends Object implements IHtmlResource
Represents one audio resource of arbitrary format
Modifier and Type | Field and Description |
---|---|
Event<EventHandler> |
Disposed |
Constructor and Description |
---|
Mp3Audio(String name,
InputStream binaryContent)
Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes this MP3 resource, disposing its content and making most methods and properties non-working
|
boolean |
equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
|
boolean |
equals(Mp3Audio other)
Checks this instance with specified font resource on reference equality
|
InputStream |
getByteContent()
Returns content of this font as byte stream
|
String |
getFilenameWithExtension()
Returns correct filename of this MP3 content, which consists of name and extension.
|
String |
getName()
Returns name of this MP3 content.
|
String |
getTextContent()
Returns content of this MP3 resource as base64-encoded string.
|
AudioType |
getType()
Returns a AudioType.Mp3
|
boolean |
isDisposed()
Determines whether this MP3 content is disposed or not
|
static boolean |
isValid(InputStream binaryContent)
Checks whether specified stream is a valid MP3 content
|
void |
save(String fullPathToFile)
Saves this MP3 resource to the specified file
|
public final Event<EventHandler> Disposed
public Mp3Audio(String name, InputStream binaryContent)
Creates new Mp3Audio class from MP3 content, represented as byte stream, and with specified name
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.IllegalArgumentException
public final void dispose()
Disposes this MP3 resource, disposing its content and making most methods and properties non-working
dispose
in interface IDisposable
public final boolean equals(IHtmlResource other)
Checks this instance with specified HTML resource on reference equality
other
- Other inheritor of IHtmlResource interfacepublic final boolean equals(Mp3Audio other)
Checks this instance with specified font resource on reference equality
other
- Other instance of Mp3Audio classpublic final InputStream getByteContent()
Returns content of this font as byte stream
getByteContent
in interface IHtmlResource
public final String getFilenameWithExtension()
Returns correct filename of this MP3 content, which consists of name and extension. Theoretically can differ from the name.
getFilenameWithExtension
in interface IHtmlResource
public final String getName()
Returns name of this MP3 content. Usually doesn't contain filename extension and theoretically can differ from filename.
getName
in interface IHtmlResource
public final String getTextContent()
Returns content of this MP3 resource as base64-encoded string. This value is cached after first invoke.
getTextContent
in interface IHtmlResource
public final AudioType getType()
Returns a AudioType.Mp3
getType
in interface IHtmlResource
public final boolean isDisposed()
Determines whether this MP3 content is disposed or not
isDisposed
in interface IAuxDisposable
public static boolean isValid(InputStream binaryContent)
Checks whether specified stream is a valid MP3 content
binaryContent
- Byte stream, that presumably contains a MP3 contentpublic final void save(String fullPathToFile)
Saves this MP3 resource to the specified file
save
in interface IHtmlResource
fullPathToFile
- Full path to the file, which will be created or rewritten