public abstract class AbstractBox extends Object implements Box
isoparser-default.properties
file so that
it is accessible by the PropertyBoxParserImpl
Modifier | Constructor and Description |
---|---|
protected |
AbstractBox(String type) |
protected |
AbstractBox(String type,
byte[] userType) |
Modifier and Type | Method and Description |
---|---|
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.
|
long |
getOffset()
Returns the position of the box in the original file.
|
Container |
getParent() |
String |
getPath() |
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(DataSource dataSource,
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.
|
void |
setParent(Container parent) |
protected String type
protected AbstractBox(String type)
protected AbstractBox(String type, byte[] userType)
public long getOffset()
Box
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(DataSource dataSource, ByteBuffer header, long contentSize, BoxParser boxParser) throws 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 Box
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 os) throws IOException
Box
writableByteChannel
.getBox
in interface Box
os
- the box's sinkIOException
- in case of problems with the Channel
public final void parseDetails()
public long getSize()
@DoNotParseDetail public String getType()
Box
@DoNotParseDetail public byte[] getUserType()
@DoNotParseDetail public Container getParent()
@DoNotParseDetail public void setParent(Container parent)
public boolean isParsed()
true
whenever the content ByteBuffer
is not null
@DoNotParseDetail public String getPath()
Copyright © 2017. All rights reserved.