public static void checkOperationalPattern1ACompliance(List<PartitionPack> partitionPacks){
  IMFErrorLogger imfErrorLogger=new IMFErrorLoggerImpl();
  for (  PartitionPack partitionPack : partitionPacks) {
    byte[] bytes=partitionPack.getOperationalPattern();
    for (int i=0; i < bytes.length; i++) {
      if ((MXFOperationalPattern1A.OPERATIONAL_PATTERN1A_KEY_MASK[i] != 0) && (MXFOperationalPattern1A.OPERATIONAL_PATTERN1A_KEY[i] != bytes[i])) {
        imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_ESSENCE_COMPONENT_ERROR,IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,MXFOperationalPattern1A.OP1A_EXCEPTION_PREFIX + String.format("Operational Pattern field in preface = 0x%x at position (zero-indexed) = %d, is different from expected value = 0x%x",bytes[i],i,MXFOperationalPattern1A.OPERATIONAL_PATTERN1A_KEY[i]));
      }
    }
    if (partitionPack.getNumberOfEssenceContainerULs() < 1) {
      imfErrorLogger.addError(IMFErrorLogger.IMFErrors.ErrorCodes.IMF_ESSENCE_COMPONENT_ERROR,IMFErrorLogger.IMFErrors.ErrorLevels.FATAL,MXFOperationalPattern1A.OP1A_EXCEPTION_PREFIX + String.format("Number of EssenceContainer ULs in partition pack = %d, at least 1 is expected",partitionPack.getNumberOfEssenceContainerULs()));
    }
  }
  if (imfErrorLogger.hasFatalErrors()) {
    throw new MXFException(String.format("Found fatal errors in the IMFTrackFile that violate IMF OP1A compliance"),imfErrorLogger);
  }
}

public static void checkOperationalPattern1ACompliance ( List < PartitionPack > partitionPacks ) { IMFErrorLogger imfErrorLogger = new IMFErrorLoggerImpl ( ) ; for ( PartitionPack partitionPack : partitionPacks ) { byte [ ] bytes = partitionPack . getOperationalPattern ( ) ; for ( int i = 0 ; i < bytes . length ; i ++ ) { if ( ( MXFOperationalPattern1A . OPERATIONAL_PATTERN1A_KEY_MASK [ i ] != 0 ) && ( MXFOperationalPattern1A . OPERATIONAL_PATTERN1A_KEY [ i ] != bytes [ i ] ) ) { imfErrorLogger . addError ( IMFErrorLogger . IMFErrors . ErrorCodes . IMF_ESSENCE_COMPONENT_ERROR , IMFErrorLogger . IMFErrors . ErrorLevels . FATAL , MXFOperationalPattern1A . OP1A_EXCEPTION_PREFIX + String . format ( "Operational Pattern field in preface = 0x%x at position (zero-indexed) = %d, is different from expected value = 0x%x" , bytes [ i ] , i , MXFOperationalPattern1A . OPERATIONAL_PATTERN1A_KEY [ i ] ) ) ; } } if ( partitionPack . getNumberOfEssenceContainerULs ( ) < 1 ) { imfErrorLogger . addError ( IMFErrorLogger . IMFErrors . ErrorCodes . IMF_ESSENCE_COMPONENT_ERROR , IMFErrorLogger . IMFErrors . ErrorLevels . FATAL , MXFOperationalPattern1A . OP1A_EXCEPTION_PREFIX + String . format ( "Number of EssenceContainer ULs in partition pack = %d, at least 1 is expected" , partitionPack . getNumberOfEssenceContainerULs ( ) ) ) ; } } if ( imfErrorLogger . hasFatalErrors ( ) ) { throw new MXFException ( String . format ( "Found fatal errors in the IMFTrackFile that violate IMF OP1A compliance" ) , imfErrorLogger ) ; } }
checks the compliance of partition packs found in an mxf file with st378 : 2004 . a runtime exception is thrown in case of non - compliance
