org.mp4parser.boxes.iso14496.part12.ItemDataBox Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isoparser Show documentation
Show all versions of isoparser Show documentation
A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)
The newest version!
package org.mp4parser.boxes.iso14496.part12;
import org.mp4parser.support.AbstractBox;
import java.nio.Buffer;
import java.nio.ByteBuffer;
/**
* 4cc = "{@value #TYPE}"
*/
public class ItemDataBox extends AbstractBox {
public static final String TYPE = "idat";
ByteBuffer data = ByteBuffer.allocate(0);
public ItemDataBox() {
super(TYPE);
}
public ByteBuffer getData() {
return data;
}
public void setData(ByteBuffer data) {
this.data = data;
}
@Override
protected long getContentSize() {
return data.limit();
}
@Override
public void _parseDetails(ByteBuffer content) {
data = content.slice();
((Buffer)content).position(content.position() + content.remaining());
}
@Override
protected void getContent(ByteBuffer byteBuffer) {
byteBuffer.put(data);
}
}