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 void
addBox(Box box)
Addbox
to 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 long
getContainerSize()
void
initContainer(ReadableByteChannel readableByteChannel, long containerSize, BoxParser boxParser)
void
setBoxes(List<? extends Box> boxes)
Sets all boxes and removes all previous child boxes.String
toString()
void
writeContainer(WritableByteChannel bb)
-
-
-
Method Detail
-
getBoxes
public List<Box> getBoxes()
Description copied from interface:Container
Gets all child boxes. May not returnnull
.
-
setBoxes
public void setBoxes(List<? extends Box> boxes)
Description copied from interface:Container
Sets 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:Container
Gets 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:Container
Gets all child boxes of the given type. May not returnnull
.
-
addBox
public void addBox(Box box)
Addbox
to the container and sets the parent correctly. Ifbox
isnull
nochange 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:
writeContainer
in interfaceContainer
- Throws:
IOException
-
-