com.coremedia.iso.boxes
Class FullContainerBox

java.lang.Object
  extended by com.coremedia.iso.boxes.AbstractBox
      extended by com.coremedia.iso.boxes.AbstractFullBox
          extended by com.coremedia.iso.boxes.FullContainerBox
All Implemented Interfaces:
Box, ContainerBox, FullBox
Direct Known Subclasses:
DataReferenceBox, ItemProtectionBox, MetaBox, OmaDrmContainerBox, OmaDrmDiscreteHeadersBox, OmaDrmKeyManagenentSystemBox, SampleDescriptionBox

public abstract class FullContainerBox
extends AbstractFullBox
implements ContainerBox

Abstract base class for a full iso box only containing ither boxes.


Field Summary
protected  List<Box> boxes
           
 
Fields inherited from class com.coremedia.iso.boxes.AbstractBox
offset, parsed
 
Constructor Summary
FullContainerBox(String type)
           
 
Method Summary
 void addBox(Box b)
           
 List<Box> getBoxes()
          Gets all child boxes.
<T extends Box>
List<T>
getBoxes(Class<T> clazz)
          Gets all child boxes of the given type.
<T extends Box>
List<T>
getBoxes(Class<T> clazz, boolean recursive)
          Gets all child boxes of the given type.
protected  void getContent(IsoOutputStream os)
          Writes the box's content into the given IsoOutputStream.
protected  long getContentSize()
          Gets the box's content size without header size where header includes flags and version.
 long getNumOfBytesToFirstChild()
          Returns the number of bytes from the start of the box to start of the first child.
 void parse(IsoBufferWrapper in, long size, BoxParser boxParser, Box lastMovieFragmentBox)
          Pareses the given IsoBufferWrapper and returns the remaining bytes.
protected  void parseBoxes(long size, IsoBufferWrapper in, BoxParser boxParser, Box lastMovieFragmentBox)
           
 void removeBox(Box b)
           
 void setBoxes(List<Box> boxes)
          Sets all boxes and removes all previous child boxes.
 String toString()
           
 
Methods inherited from class com.coremedia.iso.boxes.AbstractFullBox
getFlags, getHeader, getHeaderSize, getVersion, parseHeader, setFlags, setVersion
 
Methods inherited from class com.coremedia.iso.boxes.AbstractBox
addWriteListener, calculateOffset, getBox, getDeadBytes, getDisplayName, getIsoFile, getOffset, getParent, getSize, getType, getUserType, isParsed, setDeadBytes, setParent, setParsed, setUserType, utf8StringLengthInBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.coremedia.iso.boxes.ContainerBox
getIsoFile, getParent
 
Methods inherited from interface com.coremedia.iso.boxes.Box
calculateOffset, getBox, getOffset, getSize, getType, getUserType, isParsed
 

Field Detail

boxes

protected List<Box> boxes
Constructor Detail

FullContainerBox

public FullContainerBox(String type)
Method Detail

setBoxes

public void setBoxes(List<Box> boxes)
Description copied from interface: ContainerBox
Sets all boxes and removes all previous child boxes.

Specified by:
setBoxes in interface ContainerBox
Parameters:
boxes - the new list of children

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
Returns:
an array of boxes, empty array in case of no children.

getBoxes

public <T extends Box> List<T> getBoxes(Class<T> clazz,
                                        boolean recursive)
Description copied from interface: ContainerBox
Gets all child boxes of the given type. May not return null.

Specified by:
getBoxes in interface ContainerBox
Parameters:
clazz - child box's type
recursive - step down the tree
Returns:
an array of boxes, empty array in case of no children.

getContentSize

protected long getContentSize()
Description copied from class: AbstractFullBox
Gets the box's content size without header size where header includes flags and version.

Specified by:
getContentSize in class AbstractFullBox
Returns:
Gets the box's content size

addBox

public void addBox(Box b)

removeBox

public void removeBox(Box b)

getBoxes

public List<Box> getBoxes()
Description copied from interface: ContainerBox
Gets all child boxes. May not return null.

Specified by:
getBoxes in interface ContainerBox
Returns:
an array of boxes, empty array in case of no children.

parse

public void parse(IsoBufferWrapper in,
                  long size,
                  BoxParser boxParser,
                  Box lastMovieFragmentBox)
           throws IOException
Description copied from class: AbstractBox
Pareses the given IsoBufferWrapper and returns the remaining bytes.

Overrides:
parse in class AbstractFullBox
Parameters:
in - the (part of the) iso file to parse
size - expected size of the box
boxParser - creates inner boxes
lastMovieFragmentBox - latest of previously found moof boxes
Throws:
IOException - in case of an I/O error.

parseBoxes

protected void parseBoxes(long size,
                          IsoBufferWrapper in,
                          BoxParser boxParser,
                          Box lastMovieFragmentBox)
                   throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getContent

protected void getContent(IsoOutputStream os)
                   throws IOException
Description copied from class: AbstractBox
Writes the box's content into the given IsoOutputStream. This MUST NOT include any header bytes.

Specified by:
getContent in class AbstractBox
Parameters:
os - the box's content-sink.
Throws:
IOException - in case of an exception in the underlying OutputStream.

getNumOfBytesToFirstChild

public long getNumOfBytesToFirstChild()
Description copied from interface: ContainerBox
Returns the number of bytes from the start of the box to start of the first child.

Specified by:
getNumOfBytesToFirstChild in interface ContainerBox
Returns:
offset of first child from box start


Copyright © 2011. All Rights Reserved.