public class BoxImpl extends java.lang.Object implements Box
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<Box> |
children |
protected long |
offset |
protected Box |
parent |
protected long |
size |
protected long |
type |
| Constructor and Description |
|---|
BoxImpl(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(MP4InputStream in)
Decodes the given input stream by reading this box and all of its
children (if any).
|
Box |
getChild(long type)
Returns the child box with the specified type.
|
java.util.List<Box> |
getChildren()
Returns an ordered and unmodifiable list of all direct children of this
box.
|
java.util.List<Box> |
getChildren(long type)
Returns an ordered and unmodifiable list of all direct children of this
box with the specified type.
|
protected long |
getLeft(MP4InputStream in) |
java.lang.String |
getName()
Returns the name of this box as a human-readable string
(e.g.
|
long |
getOffset()
Returns the offset of this box in the stream/file.
|
Box |
getParent() |
long |
getSize()
Returns the size of this box including its header.
|
long |
getType()
Returns the type of this box as a 4CC converted to a long.
|
boolean |
hasChild(long type)
Indicated if the box has a child with the given type.
|
boolean |
hasChildren()
Indicates if this box has children.
|
protected void |
readChildren(MP4InputStream in) |
protected void |
readChildren(MP4InputStream in,
int len) |
void |
setParams(Box parent,
long size,
long type,
long offset) |
java.lang.String |
toString() |
protected long size
protected long type
protected long offset
protected Box parent
protected final java.util.List<Box> children
public void setParams(Box parent, long size, long type, long offset)
protected long getLeft(MP4InputStream in) throws java.io.IOException
java.io.IOExceptionpublic void decode(MP4InputStream in) throws java.io.IOException
in - an input streamjava.io.IOException - if an error occurs while readingpublic long getType()
Boxpublic long getSize()
Boxpublic long getOffset()
Boxpublic java.lang.String getName()
Boxpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean hasChildren()
BoxhasChildren in interface Boxpublic boolean hasChild(long type)
Boxpublic Box getChild(long type)
BoxhasChild(type) can be used.
If more than one child exists with the same type, the first one will
always be returned. A list of all children with that type can be received
via getChildren(type).public java.util.List<Box> getChildren()
BoxgetChildren in interface Boxpublic java.util.List<Box> getChildren(long type)
BoxgetChildren in interface Boxtype - the type of child boxes to look forprotected void readChildren(MP4InputStream in) throws java.io.IOException
java.io.IOExceptionprotected void readChildren(MP4InputStream in, int len) throws java.io.IOException
java.io.IOException