public abstract class AbstractBox extends java.lang.Object implements ParsableBox
isoparser2-default.properties file so that
it is accessible by the PropertyBoxParserImpl| Modifier and Type | Field and Description |
|---|---|
protected java.nio.ByteBuffer |
content |
protected java.lang.String |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBox(java.lang.String type) |
protected |
AbstractBox(java.lang.String type,
byte[] userType) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
_parseDetails(java.nio.ByteBuffer content)
Parse the box's fields and child boxes if any.
|
void |
getBox(java.nio.channels.WritableByteChannel os)
Writes the complete box - size | 4-cc | content - to the given
writableByteChannel. |
protected abstract void |
getContent(java.nio.ByteBuffer byteBuffer)
Write the box's content into the given
ByteBuffer. |
protected abstract long |
getContentSize()
Get the box's content size without its header.
|
long |
getSize()
Gets the full size of the box including header and content.
|
java.lang.String |
getType()
The box's 4-cc type.
|
byte[] |
getUserType() |
boolean |
isParsed()
Check if details are parsed.
|
void |
parse(java.nio.channels.ReadableByteChannel dataSource,
java.nio.ByteBuffer header,
long contentSize,
BoxParser boxParser)
Parses the box excluding the already parsed header (size, 4cc, [long-size], [user-type]).
|
void |
parseDetails()
Parses the raw content of the box.
|
protected AbstractBox(java.lang.String type)
protected AbstractBox(java.lang.String type,
byte[] userType)
protected abstract long getContentSize()
getContent(ByteBuffer) writes.getContent(java.nio.ByteBuffer)protected abstract void getContent(java.nio.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(java.nio.ByteBuffer content)
content - the box's raw content beginning after the 4-cc field.@DoNotParseDetail public void parse(java.nio.channels.ReadableByteChannel dataSource, java.nio.ByteBuffer header, long contentSize, BoxParser boxParser) throws java.io.IOException
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 ParsableBoxdataSource - 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.java.io.IOException - in case of an error during a read operationpublic void getBox(java.nio.channels.WritableByteChannel os)
throws java.io.IOException
BoxwritableByteChannel.public final void parseDetails()
public long getSize()
@DoNotParseDetail public java.lang.String getType()
Box@DoNotParseDetail public byte[] getUserType()
public boolean isParsed()
true whenever the content ByteBuffer is not nullCopyright © 2020. All rights reserved.