|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.emb.MediaSegment
This class models a portion of a (usually non-embedded) medium that is optionally followed by a reference to an external media file represented by a media location URL.
Splitting up media content into media segments is useful if references contained have to be updated, for example because one of the children has moved. In order to handle such a situation it is necessary to disassemble the media, update the reference, and reassemble it afterwards. MediaFormat instances provide the operations necessary, and the MediaSegment class describes the data container for a single segment.
The value null
is a valid value for the childLocation
property and indicates that the segment content is not followed by any
reference, for example because the end of media is reached. The content of
media segments is restricted to a theoretical maximum size of 2GB due to the
Java restriction of byte array size. However this should not impose a
restriction in practice as non-embedded media tends to be fairly small in
size, and embedded media doesn't require segmentation at all.
Media segments also implement Serializable
in order to
allow instances to be exchanged over remote boundaries.
Constructor Summary | |
MediaSegment()
Default constructor for media segments. |
Method Summary | |
java.net.URL |
getChildLocation()
Returns the media location of a media resource referenced by the receiver. |
byte[] |
getContent()
Returns the content of the media segment as a byte array. |
void |
setChildLocation(java.net.URL childLocation)
Sets the media location of a media resource referenced by the receiver. |
void |
setContent(byte[] content)
Sets the content of the media segment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MediaSegment()
null
.
Method Detail |
public byte[] getContent()
public java.net.URL getChildLocation()
public void setContent(byte[] content)
content
- the segment content.
java.lang.NullPointerException
- if the value passed is null
.public void setChildLocation(java.net.URL childLocation)
null
is allowed.
childLocation
- the child location.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |