SampleToChunkBox stsc = new SampleToChunkBox();
List<SampleToChunkBox.Entry> l = new LinkedList<SampleToChunkBox.Entry>();
for (int i = 0; i < 5; i++) {
SampleToChunkBox.Entry e = new SampleToChunkBox.Entry(i, 1, i * i);
l.add(e);
}
stsc.setEntries(l);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
stsc.getBox(Channels.newChannel(baos));
byte[] content = baos.toByteArray();
SampleToChunkBox stsc2 = new SampleToChunkBox();
stsc2.parse(new ByteBufferByteChannel(ByteBuffer.wrap(content, 8, content.length - 8)), null, content.length - 8, null);
Assert.assertEquals(content.length, stsc2.getSize());