public class MetaBox extends AbstractContainerBox
Modifier and Type | Field and Description |
---|---|
static String |
TYPE |
largeBox, type
boxParser, dataSource
Constructor and Description |
---|
MetaBox() |
Modifier and Type | Method and Description |
---|---|
void |
getBox(WritableByteChannel writableByteChannel)
Writes the complete box - size | 4-cc | content - to the given
writableByteChannel . |
int |
getFlags() |
long |
getSize() |
int |
getVersion() |
void |
parse(DataSource dataSource,
ByteBuffer header,
long contentSize,
BoxParser boxParser)
Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]).
|
protected long |
parseVersionAndFlags(ByteBuffer content)
Parses the version/flags header and returns the remaining box size.
|
void |
setFlags(int flags) |
void |
setVersion(int version) |
protected void |
writeVersionAndFlags(ByteBuffer bb) |
getHeader, getOffset, getParent, getType, initContainer, setParent
addBox, close, getBoxes, getBoxes, getBoxes, getByteBuffer, getContainerSize, hasNext, next, remove, setBoxes, toString, writeContainer
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEachRemaining
public static final String TYPE
public int getVersion()
public void setVersion(int version)
public int getFlags()
public void setFlags(int flags)
protected final long parseVersionAndFlags(ByteBuffer content)
content
- the ByteBuffer
that contains the version & flagprotected final void writeVersionAndFlags(ByteBuffer bb)
public void parse(DataSource dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException
Box
contentSize
, contentSize
number of bytes should be read from the box source (readableByteChannel
).
If you need the header
buffer at a later stage you have to create a copy.parse
in interface Box
parse
in class AbstractContainerBox
dataSource
- the source for this boxheader
- the box' already parsed header (create copy if you need it
later as it will be overwritten)contentSize
- remaining bytes of this boxboxParser
- use it to parse sub-boxes.IOException
- in case of an error during a read operationpublic void getBox(WritableByteChannel writableByteChannel) throws IOException
Box
writableByteChannel
.getBox
in interface Box
getBox
in class AbstractContainerBox
writableByteChannel
- the box's sinkIOException
- in case of problems with the Channel
public long getSize()
getSize
in interface Box
getSize
in class AbstractContainerBox
Copyright © 2017. All rights reserved.