|
@@ -1,5 +1,7 @@
|
|
|
package de.nplusc.izc.tools.baseTools;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
/*
|
|
|
* To change this template, choose Tools | Templates
|
|
|
* and open the template in the editor.
|
|
@@ -147,4 +149,20 @@ public class arraytools {
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
+ public static <T> T[] concatAll(T[] first, T[]... rest)
|
|
|
+ {
|
|
|
+ int totalLength = first.length;
|
|
|
+ for (T[] array : rest)
|
|
|
+ {
|
|
|
+ totalLength += array.length;
|
|
|
+ }
|
|
|
+ T[] result = Arrays.copyOf(first, totalLength);
|
|
|
+ int offset = first.length;
|
|
|
+ for (T[] array : rest)
|
|
|
+ {
|
|
|
+ System.arraycopy(array, 0, result, offset, array.length);
|
|
|
+ offset += array.length;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|