Methods Summary |
---|
public void | _parseChildBoxes(java.nio.ByteBuffer content)
while (content.remaining() > 8) {
try {
boxes.add(boxParser.parseBox(new ByteBufferByteChannel(content), this));
} catch (IOException e) {
throw new RuntimeException(e);
}
}
setDeadBytes(content.slice());
|
public void | _parseReservedAndDataReferenceIndex(java.nio.ByteBuffer content)
content.get(new byte[6]); // ignore 6 reserved bytes;
dataReferenceIndex = IsoTypeReader.readUInt16(content);
|
public void | _writeChildBoxes(java.nio.ByteBuffer bb)
ByteArrayOutputStream baos = new ByteArrayOutputStream();
WritableByteChannel wbc = Channels.newChannel(baos);
try {
for (Box box : boxes) {
box.getBox(wbc);
}
wbc.close();
} catch (IOException e) {
throw new RuntimeException("Cannot happen. Everything should be in memory and therefore no exceptions.");
}
bb.put(baos.toByteArray());
|
public void | _writeReservedAndDataReferenceIndex(java.nio.ByteBuffer bb)
bb.put(new byte[6]);
IsoTypeWriter.writeUInt16(bb, dataReferenceIndex);
|
public void | addBox(com.coremedia.iso.boxes.Box b)
b.setParent(this);
boxes.add(b);
|
public java.util.List | getBoxes(java.lang.Class clazz)
return getBoxes(clazz, false);
|
public java.util.List | getBoxes()
return boxes;
|
public java.util.List | getBoxes(java.lang.Class clazz, boolean recursive)
List<T> boxesToBeReturned = new ArrayList<T>(2);
for (Box boxe : boxes) { //clazz.isInstance(boxe) / clazz == boxe.getClass()?
if (clazz == boxe.getClass()) {
boxesToBeReturned.add((T) boxe);
}
if (recursive && boxe instanceof ContainerBox) {
boxesToBeReturned.addAll(((ContainerBox) boxe).getBoxes(clazz, recursive));
}
}
// Optimize here! Spare object creation work on arrays directly! System.arrayCopy
return boxesToBeReturned;
//return (T[]) boxesToBeReturned.toArray();
|
public int | getDataReferenceIndex()
return dataReferenceIndex;
|
public long | getNumOfBytesToFirstChild()
long sizeOfChildren = 0;
for (Box box : boxes) {
sizeOfChildren += box.getSize();
}
return getSize() - sizeOfChildren;
|
public void | parse(java.nio.channels.ReadableByteChannel readableByteChannel, java.nio.ByteBuffer header, long contentSize, com.coremedia.iso.BoxParser boxParser)
super.parse(readableByteChannel, header, contentSize, boxParser);
this.boxParser = boxParser;
|
public boolean | removeBox(com.coremedia.iso.boxes.Box b)
b.setParent(this);
return boxes.remove(b);
|
public void | setBoxes(java.util.List boxes)
this.boxes = new LinkedList<Box>(boxes);
|
public void | setDataReferenceIndex(int dataReferenceIndex)
this.dataReferenceIndex = dataReferenceIndex;
|
public void | setType(java.lang.String type)
this.type = type;
|