public static int [ ] ConcatenateInt ( List < int [ ] > arrays ) { int size = 0 ; for ( int i = 0 ; i < arrays . size ( ) ; i ++ ) { size += arrays . get ( i ) . length ; } int [ ] all = new int [ size ] ; int idx = 0 ; for ( int i = 0 ; i < arrays . size ( ) ; i ++ ) { int [ ] v = arrays . get ( i ) ; for ( int j = 0 ; j < v . length ; j ++ ) { all [ idx ++ ] = v [ i ] ; } } return all ; }
Concatenate all the arrays in the list into a vector .