public static boolean requiresUnsynchronization(byte[] abySource){
  for (int i=0; i < abySource.length - 1; i++) {
    if (((abySource[i] & MPEGFrameHeader.SYNC_BYTE1) == MPEGFrameHeader.SYNC_BYTE1) && ((abySource[i + 1] & MPEGFrameHeader.SYNC_BYTE2) == MPEGFrameHeader.SYNC_BYTE2)) {
      if (logger.isLoggable(Level.FINEST)) {
        logger.finest("Unsynchronisation required found bit at:" + i);
      }
      return true;
    }
  }
  return false;
}

public static boolean requiresUnsynchronization ( byte [ ] abySource ) { for ( int i = 0 ; i < abySource . length - 1 ; i ++ ) { if ( ( ( abySource [ i ] & MPEGFrameHeader . SYNC_BYTE1 ) == MPEGFrameHeader . SYNC_BYTE1 ) && ( ( abySource [ i + 1 ] & MPEGFrameHeader . SYNC_BYTE2 ) == MPEGFrameHeader . SYNC_BYTE2 ) ) { if ( logger . isLoggable ( Level . FINEST ) ) { logger . finest ( "Unsynchronisation required found bit at:" + i ) ; } return true ; } } return false ; }
check if a byte array will require unsynchronization before being written as a tag . if the byte array contains any $ ff $ e0 bytes , then it will require unsynchronization .
