Преглед на файлове

small change at ArrayTools for iZsetup. //shame on you you fricking java update for creepering my code

git-svn-id: http://repo.nplusc.de/svn/iZink@45 8b19561d-0d00-6744-8ac1-9afc8f58a8aa
masterX244 преди 12 години
родител
ревизия
ebfa08d009
променени са 1 файла, в които са добавени 18 реда и са изтрити 0 реда
  1. 18 0
      ToolKit/src/de/nplusc/izc/tools/baseTools/arraytools.java

+ 18 - 0
ToolKit/src/de/nplusc/izc/tools/baseTools/arraytools.java

@@ -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;
+    }
 }