|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.emb.GenericMediaFormat
This class offers a generic implementation of the MediaFormat
(src)
interface for use with all kinds of embedded media formats. Note that this
class should not be used to represent non-embedded media formats, as it does
not handle parent/child relationships. By registering instances of this
class with the MediaFormatRegistry
(src) described in the followup
section, various media formats can be supported in case no format specific
support is available.
The public constant DEFAULT_PROXY
contains an image that
can be used as a default proxy for all kinds of media formats or in case the
generation of a proxy fails for whatever reason.
Field Summary | |
static Media (src) |
DEFAULT_PROXY
|
Constructor Summary | |
GenericMediaFormat()
|
Method Summary | |
byte[] |
assembleContent(java.net.URL mediaLocation,
MediaSegment (src) [] mediaSegments)
Returns the content of the given media segment array's first element, or an empty byte array if no element is passed. |
MediaSegment (src) [] |
disassembleContent(java.net.URL mediaLocation,
byte[] mediaContent)
Disassembles the given media content. |
MediaHeader (src) |
extractHeader(java.io.InputStream mediaContent)
Returns an instance of class GenericMediaHeader, as this class cannot make any assumptions about header fields. |
Media (src) |
extractProxy(java.io.InputStream mediaContent)
Returns a default image that is suitable to represent all kinds of content. |
java.lang.String |
getDefaultMimeType()
Returns Media.MIME_TYPE_UNKNOWN , as this class cannot
make any assumptions about mime types. |
boolean |
isEmbedded()
Returns true , as this class assumes media to be embedded. |
boolean |
isStreamingDesirable()
Returns false , as this class cannot make any assumptions
about media to be streamable or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Media (src) DEFAULT_PROXY
Constructor Detail |
public GenericMediaFormat()
Method Detail |
public byte[] assembleContent(java.net.URL mediaLocation, MediaSegment (src) [] mediaSegments) throws MediaException (src)
assembleContent
in interface MediaFormat (src)
mediaLocation
- the intended location of the media to be assembled.mediaSegments
- the segments that are to be assembled.
FormatSyntaxException (src)
- if the given media segment array
contains more than one element, or if an element is passed that
contains a child link that is not null
.
java.lang.NullPointerException
- if the given segment array is
null
.
ContentTooLargeException (src)
- if the assembled content is
larger than the maximum Java array size of 2 GB.
MediaException (src)
public MediaSegment (src) [] disassembleContent(java.net.URL mediaLocation, byte[] mediaContent) throws MediaException (src)
null
as child location and the
given media content as content.
disassembleContent
in interface MediaFormat (src)
mediaLocation
- the location of the media to be disassembled.mediaContent
- the content to be disassembled.
java.lang.NullPointerException
- if the content passed is null
.
MediaException (src)
public MediaHeader (src) extractHeader(java.io.InputStream mediaContent) throws MediaException (src)
extractHeader
in interface MediaFormat (src)
mediaContent
- the media content to extract the header from.
java.lang.NullPointerException
- if the value passed is null
.
MediaException (src)
public Media (src) extractProxy(java.io.InputStream mediaContent) throws MediaException (src)
extractProxy
in interface MediaFormat (src)
mediaContent
- the media content.
MediaException (src)
- if proxy can't be generated.public java.lang.String getDefaultMimeType()
Media.MIME_TYPE_UNKNOWN
, as this class cannot
make any assumptions about mime types.
getDefaultMimeType
in interface MediaFormat (src)
Media.MIME_TYPE_UNKNOWN
.public boolean isEmbedded()
true
, as this class assumes media to be embedded.
isEmbedded
in interface MediaFormat (src)
true
.public boolean isStreamingDesirable()
false
, as this class cannot make any assumptions
about media to be streamable or not.
isStreamingDesirable
in interface MediaFormat (src)
false
.
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |