From 582e6f1c89567288aced7f62e02c72237b9ac1b2 Mon Sep 17 00:00:00 2001 From: andrzej Date: Thu, 25 Jan 2007 03:32:59 +0000 Subject: [PATCH] Added a concatenate method for integer arrays. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2039 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/ArrayUtil.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/java/com/samskivert/util/ArrayUtil.java b/src/java/com/samskivert/util/ArrayUtil.java index ff7028e6..171453b9 100644 --- a/src/java/com/samskivert/util/ArrayUtil.java +++ b/src/java/com/samskivert/util/ArrayUtil.java @@ -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.