Cleanup: use generic list instead of low level array

This commit is contained in:
Laurent Clouet
2015-01-25 19:07:32 +00:00
parent 741601712d
commit f444bd5526
6 changed files with 31 additions and 47 deletions

View File

@@ -28,7 +28,6 @@ import java.io.InputStream;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
@@ -233,18 +232,4 @@ public class Utils {
}
return Math.round(Double.parseDouble(m.group(1)) * scale);
}
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;
}
}