FileDocCategorySizeDatePackage
AppleDataBox.javaAPI Docmp4parser 1.0-RC-172475Wed Dec 19 20:10:37 GMT 2012com.coremedia.iso.boxes.apple

AppleDataBox

public final class AppleDataBox extends com.googlecode.mp4parser.AbstractFullBox
Most stupid box of the world. Encapsulates actual data within

Fields Summary
public static final String
TYPE
private byte[]
fourBytes
private byte[]
data
Constructors Summary
public AppleDataBox()

        super(TYPE);
    
Methods Summary
public void_parseDetails(java.nio.ByteBuffer content)

        parseVersionAndFlags(content);
        fourBytes = new byte[4];
        content.get(fourBytes);
        data = new byte[content.remaining()];
        content.get(data);
    
protected voidgetContent(java.nio.ByteBuffer byteBuffer)

        writeVersionAndFlags(byteBuffer);
        byteBuffer.put(fourBytes, 0, 4);
        byteBuffer.put(data);
    
protected longgetContentSize()

        return data.length + 8;
    
public byte[]getData()

        return data;
    
private static com.coremedia.iso.boxes.apple.AppleDataBoxgetEmpty()


        
        AppleDataBox appleDataBox = new AppleDataBox();
        appleDataBox.setVersion(0);
        appleDataBox.setFourBytes(new byte[4]);
        return appleDataBox;
    
public byte[]getFourBytes()

        return fourBytes;
    
public static com.coremedia.iso.boxes.apple.AppleDataBoxgetStringAppleDataBox()

        AppleDataBox appleDataBox = getEmpty();
        appleDataBox.setFlags(1);
        appleDataBox.setData(new byte[]{0});
        return appleDataBox;
    
public static com.coremedia.iso.boxes.apple.AppleDataBoxgetUint16AppleDataBox()

        AppleDataBox appleDataBox = new AppleDataBox();
        appleDataBox.setFlags(21);
        appleDataBox.setData(new byte[]{0, 0});
        return appleDataBox;
    
public static com.coremedia.iso.boxes.apple.AppleDataBoxgetUint32AppleDataBox()

        AppleDataBox appleDataBox = new AppleDataBox();
        appleDataBox.setFlags(21);
        appleDataBox.setData(new byte[]{0, 0, 0, 0});
        return appleDataBox;
    
public static com.coremedia.iso.boxes.apple.AppleDataBoxgetUint8AppleDataBox()

        AppleDataBox appleDataBox = new AppleDataBox();
        appleDataBox.setFlags(21);
        appleDataBox.setData(new byte[]{0});
        return appleDataBox;
    
public voidsetData(byte[] data)

        this.data = new byte[data.length];
        System.arraycopy(data, 0, this.data, 0, data.length);
    
public voidsetFourBytes(byte[] fourBytes)

        System.arraycopy(fourBytes, 0, this.fourBytes, 0, 4);