public static int[] concatAllInt(int[]... arrays){
  int totalLength=0;
  final int subArrayCount=arrays.length;
  for (int i=0; i < subArrayCount; ++i) {
    totalLength+=arrays[i].length;
  }
  int[] result=Arrays.copyOf(arrays[0],totalLength);
  int offset=arrays[0].length;
  for (int i=1; i < subArrayCount; ++i) {
    System.arraycopy(arrays[i],0,result,offset,arrays[i].length);
    offset+=arrays[i].length;
  }
  return result;
}

public static int [ ] concatAllInt ( int [ ] ... arrays ) { int totalLength = 0 ; final int subArrayCount = arrays . length ; for ( int i = 0 ; i < subArrayCount ; ++ i ) { totalLength += arrays [ i ] . length ; } int [ ] result = Arrays . copyOf ( arrays [ 0 ] , totalLength ) ; int offset = arrays [ 0 ] . length ; for ( int i = 1 ; i < subArrayCount ; ++ i ) { System . arraycopy ( arrays [ i ] , 0 , result , offset , arrays [ i ] . length ) ; offset += arrays [ i ] . length ; } return result ; }
concatenates a list of int arrays into a single array .
