public static void readCacheConfigurations(BinaryRawReaderEx in,IgniteConfiguration cfg){
  int len=in.readInt();
  if (len == 0)   return;
  List<CacheConfiguration> caches=new ArrayList<>();
  for (int i=0; i < len; i++)   caches.add(readCacheConfiguration(in));
  CacheConfiguration[] oldCaches=cfg.getCacheConfiguration();
  CacheConfiguration[] caches0=caches.toArray(new CacheConfiguration[caches.size()]);
  if (oldCaches == null)   cfg.setCacheConfiguration(caches0);
 else {
    CacheConfiguration[] mergedCaches=new CacheConfiguration[oldCaches.length + caches.size()];
    System.arraycopy(oldCaches,0,mergedCaches,0,oldCaches.length);
    System.arraycopy(caches0,0,mergedCaches,oldCaches.length,caches.size());
    cfg.setCacheConfiguration(mergedCaches);
  }
}

public static void readCacheConfigurations ( BinaryRawReaderEx in , IgniteConfiguration cfg ) { int len = in . readInt ( ) ; if ( len == 0 ) return ; List < CacheConfiguration > caches = new ArrayList < > ( ) ; for ( int i = 0 ; i < len ; i ++ ) caches . add ( readCacheConfiguration ( in ) ) ; CacheConfiguration [ ] oldCaches = cfg . getCacheConfiguration ( ) ; CacheConfiguration [ ] caches0 = caches . toArray ( new CacheConfiguration [ caches . size ( ) ] ) ; if ( oldCaches == null ) cfg . setCacheConfiguration ( caches0 ) ; else { CacheConfiguration [ ] mergedCaches = new CacheConfiguration [ oldCaches . length + caches . size ( ) ] ; System . arraycopy ( oldCaches , 0 , mergedCaches , 0 , oldCaches . length ) ; System . arraycopy ( caches0 , 0 , mergedCaches , oldCaches . length , caches . size ( ) ) ; cfg . setCacheConfiguration ( mergedCaches ) ; } }
reads cache configurations from a stream and updates provided igniteconfiguration .
