|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.coremedia.iso.boxes.AbstractBox
public abstract class AbstractBox
A basic ISO box. No full box.
Field Summary | |
---|---|
protected java.nio.ByteBuffer |
deadBytes
|
protected java.lang.String |
type
|
Constructor Summary | |
---|---|
protected |
AbstractBox(java.lang.String type)
|
Method Summary | |
---|---|
abstract void |
_parseDetails(java.nio.ByteBuffer content)
Implement the actual parsing of the box's fields here. |
void |
getBox(java.nio.channels.WritableByteChannel os)
|
protected abstract void |
getContent(java.nio.ByteBuffer bb)
Writes the box's content into the given ByteBuffer . |
protected abstract long |
getContentSize()
Gets the box's content size. |
java.nio.ByteBuffer |
getDeadBytes()
|
void |
getHeader(java.nio.ByteBuffer byteBuffer)
|
IsoFile |
getIsoFile()
|
ContainerBox |
getParent()
|
long |
getSize()
|
java.lang.String |
getType()
|
byte[] |
getUserType()
|
boolean |
isParsed()
|
void |
parse(java.nio.channels.ReadableByteChannel in,
java.nio.ByteBuffer header,
long contentSize,
BoxParser boxParser)
Pareses the given IsoBufferWrapper and returns the remaining bytes. |
void |
parseDetails()
Parses the boxes fields. |
void |
setDeadBytes(java.nio.ByteBuffer newDeadBytes)
|
void |
setParent(ContainerBox parent)
|
void |
setUserType(byte[] userType)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String type
protected java.nio.ByteBuffer deadBytes
Constructor Detail |
---|
protected AbstractBox(java.lang.String type)
Method Detail |
---|
public long getSize()
getSize
in interface Box
public boolean isParsed()
protected abstract long getContentSize()
@DoNotParseDetail public java.lang.String getType()
getType
in interface Box
@DoNotParseDetail public byte[] getUserType()
@DoNotParseDetail public void setUserType(byte[] userType)
@DoNotParseDetail public ContainerBox getParent()
getParent
in interface Box
@DoNotParseDetail public void setParent(ContainerBox parent)
setParent
in interface Box
@DoNotParseDetail public IsoFile getIsoFile()
@DoNotParseDetail public void parse(java.nio.channels.ReadableByteChannel in, java.nio.ByteBuffer header, long contentSize, BoxParser boxParser) throws java.io.IOException
parse
in interface Box
in
- the (part of the) iso file to parsecontentSize
- expected contentSize of the boxboxParser
- creates inner boxes
java.io.IOException
- in case of an I/O error.public final void parseDetails()
public abstract void _parseDetails(java.nio.ByteBuffer content)
parseDetails()
which encapsulates the call to this method with some safeguards.
content
- public java.nio.ByteBuffer getDeadBytes()
public void setDeadBytes(java.nio.ByteBuffer newDeadBytes)
public void getHeader(java.nio.ByteBuffer byteBuffer)
public void getBox(java.nio.channels.WritableByteChannel os) throws java.io.IOException
getBox
in interface Box
java.io.IOException
protected abstract void getContent(java.nio.ByteBuffer bb) throws java.io.IOException
ByteBuffer
. This must include flags
and version in case of a full box. bb
has been initialized with
getSize()
bytes.
bb
- the box's content-sink.
java.io.IOException
- in case of an exception in the underlying OutputStream
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |