Added a concatenate method for integer arrays.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2039 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
andrzej
2007-01-25 03:32:59 +00:00
parent 7e9a807c5d
commit 582e6f1c89
@@ -804,6 +804,18 @@ public class ArrayUtil
return insert(values, value, values.length);
}
/**
* Creates a new array that contains the contents of the first parameter
* array followed by those of the second.
*/
public static int[] concatenate (int[] v1, int[] v2)
{
int[] values = new int[v1.length + v2.length];
System.arraycopy(v1, 0, values, 0, v1.length);
System.arraycopy(v2, 0, values, v1.length, v2.length);
return values;
}
/**
* Creates a new array that contains the contents of the first parameter
* array followed by those of the second.