ItemDataBox.java revision dd9eb897ee7c7b507cbdcf80263bb4b5de6966bf
1package com.coremedia.iso.boxes; 2 3import com.googlecode.mp4parser.AbstractBox; 4 5import java.nio.ByteBuffer; 6 7/** 8 * 9 */ 10public class ItemDataBox extends AbstractBox { 11 ByteBuffer data = ByteBuffer.allocate(0); 12 public static final String TYPE = "idat"; 13 14 15 public ItemDataBox() { 16 super(TYPE); 17 } 18 19 public ByteBuffer getData() { 20 return data; 21 } 22 23 public void setData(ByteBuffer data) { 24 this.data = data; 25 } 26 27 @Override 28 protected long getContentSize() { 29 return data.limit(); 30 } 31 32 33 @Override 34 public void _parseDetails(ByteBuffer content) { 35 data = content.slice(); 36 content.position(content.position() + content.remaining()); 37 } 38 39 @Override 40 protected void getContent(ByteBuffer byteBuffer) { 41 byteBuffer.put(data); 42 } 43} 44