|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.coremedia.iso.boxes.AbstractBox
com.coremedia.iso.boxes.AbstractContainerBox
public abstract class AbstractContainerBox
Abstract base class suitable for most boxes acting purely as container for other boxes.
| Field Summary | |
|---|---|
protected java.util.List<Box> |
boxes
|
protected BoxParser |
boxParser
|
| Fields inherited from class com.coremedia.iso.boxes.AbstractBox |
|---|
deadBytes, type |
| Constructor Summary | |
|---|---|
AbstractContainerBox(java.lang.String type)
|
|
| Method Summary | ||
|---|---|---|
void |
_parseDetails(java.nio.ByteBuffer content)
Implement the actual parsing of the box's fields here. |
|
void |
addBox(Box b)
Add b to the container and sets the parent correctly. |
|
java.util.List<Box> |
getBoxes()
Gets all child boxes. |
|
|
getBoxes(java.lang.Class<T> clazz)
Gets all child boxes of the given type. |
|
|
getBoxes(java.lang.Class<T> clazz,
boolean recursive)
Gets all child boxes of the given type. |
|
protected void |
getContent(java.nio.ByteBuffer bb)
Writes the box's content into the given ByteBuffer. |
|
protected long |
getContentSize()
Gets the box's content size. |
|
long |
getNumOfBytesToFirstChild()
The number of bytes from box start (first length byte) to the first length byte of the first child box |
|
void |
parse(java.nio.channels.ReadableByteChannel in,
java.nio.ByteBuffer header,
long contentSize,
BoxParser boxParser)
Pareses the given IsoBufferWrapper and returns the remaining bytes. |
|
protected void |
parseChildBoxes(java.nio.ByteBuffer content)
|
|
void |
removeBox(Box b)
|
|
void |
setBoxes(java.util.List<Box> boxes)
Sets all boxes and removes all previous child boxes. |
|
java.lang.String |
toString()
|
|
protected void |
writeChildBoxes(java.nio.ByteBuffer bb)
|
|
| Methods inherited from class com.coremedia.iso.boxes.AbstractBox |
|---|
getBox, getDeadBytes, getHeader, getIsoFile, getParent, getSize, getType, getUserType, isParsed, parseDetails, setDeadBytes, setParent, setUserType |
| 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 |
|---|
getBox, getSize, getType, setParent |
| Field Detail |
|---|
protected java.util.List<Box> boxes
protected BoxParser boxParser
| Constructor Detail |
|---|
public AbstractContainerBox(java.lang.String type)
| Method Detail |
|---|
protected long getContentSize()
AbstractBox
getContentSize in class AbstractBoxpublic java.util.List<Box> getBoxes()
ContainerBoxnull.
getBoxes in interface ContainerBoxpublic void setBoxes(java.util.List<Box> boxes)
ContainerBox
setBoxes in interface ContainerBoxboxes - the new list of childrenpublic <T extends Box> java.util.List<T> getBoxes(java.lang.Class<T> clazz)
ContainerBoxnull.
getBoxes in interface ContainerBoxclazz - child box's type
public <T extends Box> java.util.List<T> getBoxes(java.lang.Class<T> clazz,
boolean recursive)
ContainerBoxnull.
getBoxes in interface ContainerBoxclazz - child box's typerecursive - step down the tree
public void addBox(Box b)
b to the container and sets the parent correctly.
b - will be added to the containerpublic void removeBox(Box b)
public void parse(java.nio.channels.ReadableByteChannel in,
java.nio.ByteBuffer header,
long contentSize,
BoxParser boxParser)
throws java.io.IOException
AbstractBox
parse in interface Boxparse in class AbstractBoxin - the (part of the) iso file to parsecontentSize - expected contentSize of the boxboxParser - creates inner boxes
java.io.IOException - in case of an I/O error.public void _parseDetails(java.nio.ByteBuffer content)
AbstractBoxAbstractBox.parseDetails() which encapsulates the call to this method with some safeguards.
_parseDetails in class AbstractBoxpublic java.lang.String toString()
toString in class java.lang.Objectpublic long getNumOfBytesToFirstChild()
getNumOfBytesToFirstChild in interface ContainerBox
protected void getContent(java.nio.ByteBuffer bb)
throws java.io.IOException
AbstractBoxByteBuffer. This must include flags
and version in case of a full box. bb has been initialized with
getSize() bytes.
getContent in class AbstractBoxbb - the box's content-sink.
java.io.IOException - in case of an exception in the underlying OutputStream.protected final void parseChildBoxes(java.nio.ByteBuffer content)
protected final void writeChildBoxes(java.nio.ByteBuffer bb)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||