tenc.setDefault_KID(new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6});
tenc.setDefaultAlgorithmId(0x0a0b0c);
tenc.setDefaultIvSize(8);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
long sizeBeforeWrite = tenc.getSize();
tenc.getBox(Channels.newChannel(baos));
Assert.assertEquals(baos.size(), tenc.getSize());
Assert.assertEquals(baos.size(), sizeBeforeWrite);
IsoFile iso = new IsoFile(new ByteBufferByteChannel(ByteBuffer.wrap(baos.toByteArray())));
Assert.assertTrue(iso.getBoxes().get(0) instanceof AbstractTrackEncryptionBox);
AbstractTrackEncryptionBox tenc2 = (AbstractTrackEncryptionBox) iso.getBoxes().get(0);
Assert.assertEquals(0, tenc2.getFlags());
Assert.assertTrue(tenc.equals(tenc2));
Assert.assertTrue(tenc2.equals(tenc));