|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.googlecode.mp4parser.AbstractBox
public abstract class AbstractBox
A basic on-demand parsing box. Requires the implementation of three methods to become a fully working box:
additionally this new box has to be put into theisoparser-default.properties
file so that
it is accessible by the PropertyBoxParserImpl
Field Summary | |
---|---|
protected String |
type
|
Constructor Summary | |
---|---|
protected |
AbstractBox(String type)
|
protected |
AbstractBox(String type,
byte[] userType)
|
Method Summary | |
---|---|
protected abstract void |
_parseDetails(ByteBuffer content)
Parse the box's fields and child boxes if any. |
void |
getBox(WritableByteChannel os)
Writes the complete box - size | 4-cc | content - to the given writableByteChannel . |
protected abstract void |
getContent(ByteBuffer byteBuffer)
Write the box's content into the given ByteBuffer . |
protected abstract long |
getContentSize()
Get the box's content size without its header. |
IsoFile |
getIsoFile()
|
ContainerBox |
getParent()
|
long |
getSize()
Gets the full size of the box including header and content. |
String |
getType()
The box's 4-cc type. |
byte[] |
getUserType()
|
boolean |
isParsed()
Check if details are parsed. |
void |
parse(ReadableByteChannel readableByteChannel,
ByteBuffer header,
long contentSize,
BoxParser boxParser)
Read the box's content from a byte channel without parsing it. |
protected void |
setDeadBytes(ByteBuffer newDeadBytes)
Sets the 'dead' bytes. |
void |
setParent(ContainerBox parent)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String type
Constructor Detail |
---|
protected AbstractBox(String type)
protected AbstractBox(String type, byte[] userType)
Method Detail |
---|
protected abstract long getContentSize()
getContent(ByteBuffer)
writes.
getContent(java.nio.ByteBuffer)
protected abstract void getContent(ByteBuffer byteBuffer)
ByteBuffer
. This must include flags
and version in case of a full box. byteBuffer
has been initialized with
getSize()
bytes.
byteBuffer
- the sink for the box's contentprotected abstract void _parseDetails(ByteBuffer content)
content
- the box's raw content beginning after the 4-cc field.@DoNotParseDetail public void parse(ReadableByteChannel readableByteChannel, ByteBuffer header, long contentSize, BoxParser boxParser) throws IOException
parse
in interface Box
readableByteChannel
- the (part of the) iso file to parsecontentSize
- expected contentSize of the boxboxParser
- creates inner boxes
IOException
- in case of an I/O error.public void getBox(WritableByteChannel os) throws IOException
Box
writableByteChannel
.
getBox
in interface Box
os
- the box's sink
IOException
- in case of problems with the Channel
protected void setDeadBytes(ByteBuffer newDeadBytes)
newDeadBytes
- the unused bytes with no meaning but required for bytewise reconstructionpublic long getSize()
getSize
in interface Box
@DoNotParseDetail public String getType()
Box
getType
in interface Box
@DoNotParseDetail public byte[] getUserType()
@DoNotParseDetail public ContainerBox getParent()
getParent
in interface Box
@DoNotParseDetail public void setParent(ContainerBox parent)
setParent
in interface Box
@DoNotParseDetail public IsoFile getIsoFile()
public boolean isParsed()
true
whenever the content ByteBuffer
is not null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |