FileDocCategorySizeDatePackage
SampleDependencyTypeBoxTest.javaAPI Docmp4parser 1.0-RC-171200Wed Dec 19 20:10:22 GMT 2012com.coremedia.iso.boxes

SampleDependencyTypeBoxTest

public class SampleDependencyTypeBoxTest extends Object

Fields Summary
Constructors Summary
Methods Summary
public voidtestParse()

        SampleDependencyTypeBox stsc = new SampleDependencyTypeBox();
        List<SampleDependencyTypeBox.Entry> l = new LinkedList<SampleDependencyTypeBox.Entry>();
        for (int i = 0; i < 0xcf; i++) {
            SampleDependencyTypeBox.Entry e = new SampleDependencyTypeBox.Entry(i);
            l.add(e);
        }
        stsc.setEntries(l);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        stsc.getBox(Channels.newChannel(baos));
        byte[] content = baos.toByteArray();

        SampleDependencyTypeBox stsc2 = new SampleDependencyTypeBox();
        stsc2.parse(new ByteBufferByteChannel(ByteBuffer.wrap(content, 8, content.length - 8)), null, content.length - 8, null);
        Assert.assertEquals(content.length, stsc2.getSize());