Package org.mp4parser
Class BasicContainer
- java.lang.Object
-
- org.mp4parser.BasicContainer
-
- All Implemented Interfaces:
Container
- Direct Known Subclasses:
AbstractContainerBox,IsoFile
public class BasicContainer extends Object implements Container
-
-
Constructor Summary
Constructors Constructor Description BasicContainer()BasicContainer(List<Box> boxes)
-
Method Summary
Modifier and Type Method Description voidaddBox(Box box)Addboxto the container and sets the parent correctly.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 longgetContainerSize()voidinitContainer(ReadableByteChannel readableByteChannel, long containerSize, BoxParser boxParser)voidsetBoxes(List<? extends Box> boxes)Sets all boxes and removes all previous child boxes.StringtoString()voidwriteContainer(WritableByteChannel bb)
-
-
-
Method Detail
-
getBoxes
public List<Box> getBoxes()
Description copied from interface:ContainerGets all child boxes. May not returnnull.
-
setBoxes
public void setBoxes(List<? extends Box> boxes)
Description copied from interface:ContainerSets all boxes and removes all previous child boxes.
-
getContainerSize
protected long getContainerSize()
-
getBoxes
public <T extends Box> List<T> getBoxes(Class<T> clazz)
Description copied from interface:ContainerGets all child boxes of the given type. May not returnnull.
-
getBoxes
public <T extends Box> List<T> getBoxes(Class<T> clazz, boolean recursive)
Description copied from interface:ContainerGets all child boxes of the given type. May not returnnull.
-
addBox
public void addBox(Box box)
Addboxto the container and sets the parent correctly. Ifboxisnullnochange will be performed and no error thrown.- Parameters:
box- will be added to the container
-
initContainer
public void initContainer(ReadableByteChannel readableByteChannel, long containerSize, BoxParser boxParser) throws IOException
- Throws:
IOException
-
writeContainer
public final void writeContainer(WritableByteChannel bb) throws IOException
- Specified by:
writeContainerin interfaceContainer- Throws:
IOException
-
-