|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.media.format.EmbeddedMediaFormat
Facade around GenericMediaFormat
to represent embedded media
formats.
Constructor Summary | |
EmbeddedMediaFormat()
|
Method Summary | |
byte[] |
assembleContent(java.net.URL mediaLocation,
MediaSegment (src) [] mediaSegments)
Assembles the given media segments and returns the resulting media content as a byte array. |
MediaSegment (src) [] |
disassembleContent(java.net.URL mediaLocation,
byte[] mediaContent)
Disassembles the given media content into an array of media segments preserving the order of the original content, and returns said array of media segments. |
abstract MediaHeader (src) |
extractHeader(java.io.InputStream content)
Extracts a media header instance from the given media content and returns it. |
Media (src) |
extractProxy(java.io.InputStream content)
Extracts a proxy from the given media content and returns it. |
abstract java.lang.String |
getDefaultMimeType()
Returns the default MIME type for the given media format as a String. |
boolean |
isEmbedded()
Returns false if the media format allows links to external
media, or true otherwise. |
abstract boolean |
isStreamingDesirable()
Returns true if it is always desirable to stream media of
this format, or false otherwise. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EmbeddedMediaFormat()
Method Detail |
public final byte[] assembleContent(java.net.URL mediaLocation, MediaSegment (src) [] mediaSegments) throws MediaException (src)
MediaFormat (src)
null
, all links in the resulting media content will be
URLs. In case it is not null
, those links that can be
expressed relative to the given URL will be relative file paths, and all
others will be URLs.
This means a media object that has been disassembled into media segments beforehand can be reassembled using this operation. The given media location is used to handle relative links to external media correctly. Media Entity Beans use this operation when maintaining referential integrity between complex graphs of persistent, non-embedded, media objects. The implicit limitation of media size to a theoretical limit of 2GB should not impose a restriction in practice as this operation is only of value for non-embedded media, which tends to be relatively small in size.
assembleContent
in interface MediaFormat (src)
mediaLocation
- the intended location of the media to be assembled.mediaSegments
- the segments that are to be assembled.
MediaException (src)
public final MediaSegment (src) [] disassembleContent(java.net.URL mediaLocation, byte[] mediaContent) throws MediaException (src)
MediaFormat (src)
In case of simple media formats, the resulting media segment array
contains exactly one element, which consists of null
as
child location and the complete media content as content. Media Entity
Beans use this operation when maintaining referential integrity between
complex graphs of persistent, non embedded, media objects. Note that this
operation is only of value for non-embedded media formats. As the
reassembly is limited to media up to 2GB in size, the
MediaFormat.isEmbedded()
operation should be used to determine if
disassembling a given media content is of value beforehand.
disassembleContent
in interface MediaFormat (src)
mediaLocation
- the location of the media to be disassembled.mediaContent
- the content to be disassembled.
MediaException (src)
public abstract MediaHeader (src) extractHeader(java.io.InputStream content) throws MediaException (src)
MediaFormat (src)
Please note that the given input stream is not closed once the operation is successfully completed.
extractHeader
in interface MediaFormat (src)
content
- the media content to extract the header from.
MediaException (src)
public Media (src) extractProxy(java.io.InputStream content) throws MediaException (src)
MediaFormat (src)
GenericMediaFormat.GENERIC_PROXY
.
Please note that the given input stream is closed once the operation is
completed.
extractProxy
in interface MediaFormat (src)
content
- the content to extract the proxy from.
MediaException (src)
- if the given media is not compatible
with the receiverpublic abstract java.lang.String getDefaultMimeType()
MediaFormat (src)
Media.MIME_TYPE_UNKNOWN
should be returned.
getDefaultMimeType
in interface MediaFormat (src)
public final boolean isEmbedded()
MediaFormat (src)
false
if the media format allows links to external
media, or true otherwise. It can be used to determine if the media
content has to be examined and possibly altered when a persistent media
object is moved from one location to another while having child and/or
parent dependencies to other media objects.
isEmbedded
in interface MediaFormat (src)
true
if the format is embedded, false
if it is non-embedded.public abstract boolean isStreamingDesirable()
MediaFormat (src)
true
if it is always desirable to stream media of
this format, or false otherwise. For example, it is not always desirable
to stream JPEG or GIF images, even given the possibility to stream them
with a Real player. Servlets can use this information to decide whether
they should try to stream content or transfer it using burst transfer
instead.
isStreamingDesirable
in interface MediaFormat (src)
true
if it desirable to stream the format, false
otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |