|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.sound.AAudio
public class AAudio
Represents an audio. Unlike javax.sound.AudioClip, this class is used only to hold the raw data as opaque rather than manilupate the sound.
In other words, it is used to retrieve and store the opaque data
as polymorphic thru the Media interface.
| Field Summary | |
|---|---|
protected static java.io.InputStream |
DYNAMIC_STREAM
Used if you want to implement a meida whose input stream is created dynamically each time getStreamData() is called. |
| Constructor Summary | |
|---|---|
AAudio(java.io.File file)
|
|
AAudio(java.io.InputStream is)
|
|
AAudio(java.lang.String filename)
|
|
AAudio(java.lang.String name,
byte[] data)
|
|
AAudio(java.lang.String name,
java.io.InputStream isdata)
Creates an instance of an audio with an input stream. |
|
AAudio(java.net.URL url)
|
|
| Method Summary | |
|---|---|
byte[] |
getByteData()
Returns the raw data in byte array. |
java.lang.String |
getContentType()
Returns the content type, e.g., "image/jpeg", or null if not available. |
java.lang.String |
getFormat()
Returns the format name, e.g., "jpeg", or null if not available. |
java.lang.String |
getName()
Returns the name (usually filename) of this media, or null if not available. |
java.io.Reader |
getReaderData()
Always throws IllegalStateException. |
java.io.InputStream |
getStreamData()
Always throws IllegalStateException. |
java.lang.String |
getStringData()
Always throws IllegalStateException. |
boolean |
inMemory()
Returns whether the data is cached in memory (in form of byte[] or String). |
boolean |
isBinary()
Returns whether the format of tis content is binary or text-based. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.io.InputStream DYNAMIC_STREAM
getStreamData() is called.
AAudio(String,,InputStream)| Constructor Detail |
|---|
public AAudio(java.lang.String name,
byte[] data)
throws java.io.IOException
java.io.IOException
public AAudio(java.lang.String name,
java.io.InputStream isdata)
throws java.io.IOException
getStreamData() is called,
you can pass DYNAMIC_STREAM to the dat argument, and then
override getStreamData().
java.io.IOException
public AAudio(java.net.URL url)
throws java.io.IOException
java.io.IOException
public AAudio(java.io.File file)
throws java.io.IOException
java.io.IOException
public AAudio(java.lang.String filename)
throws java.io.IOException
java.io.IOException
public AAudio(java.io.InputStream is)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public final boolean isBinary()
MediaMedia.getByteData() or Media.getStreamData(), depending on
Media.inMemory(), to retrieve its content.
If false, use Media.getStringData() or Media.getReaderData(), depending on
Media.inMemory(), to retrieve its content.
To decide which API to use, you need to examine
both Media.isBinary() and Media.inMemory().
isBinary in interface MediaMedia.getStringData(),
Media.getByteData(),
Media.getReaderData(),
Media.getStreamData()public final boolean inMemory()
MediaMedia.getByteData() or Media.getStringData(), depending on
Media.isBinary(), to retrieve its content.
If false, use Media.getStreamData() or Media.getReaderData(), depending on
Media.isBinary(), to retrieve its content.
To decide which API to use, you need to examine
both Media.isBinary() and Media.inMemory().
inMemory in interface MediaMedia.getStringData(),
Media.getByteData(),
Media.getReaderData(),
Media.getStreamData()public byte[] getByteData()
MediaIt might not be a copy, so don't modify it directly unless you know what you are doing.
getByteData in interface MediaMedia.getStringData()public final java.lang.String getStringData()
getStringData in interface MediaMedia.getByteData()public java.io.InputStream getStreamData()
getStreamData in interface MediaMedia.getReaderData()public final java.io.Reader getReaderData()
getReaderData in interface MediaMedia.getStreamData()public final java.lang.String getName()
Media
getName in interface Mediapublic final java.lang.String getFormat()
Media
getFormat in interface MediaMedia.getContentType()public final java.lang.String getContentType()
Media
getContentType in interface MediaMedia.getFormat()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||