FileDocCategorySizeDatePackage
IsoFileTest.javaAPI Docmp4parser 1.0-RC-17715Wed Dec 19 20:10:22 GMT 2012com.coremedia.iso

IsoFileTest.java

package com.coremedia.iso;

import junit.framework.TestCase;

/**
 *
 */
public class IsoFileTest extends TestCase {
  public void testFourCC() {
    assertEquals("AA\0\0", IsoFile.bytesToFourCC(new byte[]{65, 65}));
    assertEquals("AAAA", IsoFile.bytesToFourCC(new byte[]{65, 65, 65, 65, 65, 65}));
    assertEquals("AAAA", new String(IsoFile.fourCCtoBytes("AAAAAAA")));
    assertEquals("AA\0\0", new String(IsoFile.fourCCtoBytes("AA")));
    assertEquals("\0\0\0\0", new String(IsoFile.fourCCtoBytes(null)));
    assertEquals("\0\0\0\0", new String(IsoFile.fourCCtoBytes("")));
    assertEquals("\0\0\0\0", IsoFile.bytesToFourCC(null));
    assertEquals("\0\0\0\0", IsoFile.bytesToFourCC(new byte[0]));

  }
}