Java Array Concatenate concatIntArrays(final int[] l1, final int[] l2)

Here you can find the source of concatIntArrays(final int[] l1, final int[] l2)

Description

concat Int Arrays

License

Open Source License

Declaration

public static int[] concatIntArrays(final int[] l1, final int[] l2) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Arrays;

public class Main {
    public static int[] concatIntArrays(final int[] l1, final int[] l2) {
        if (l1 == null)
            return l2;
        if (l2 == null)
            return l1;
        final int[] result = Arrays.copyOf(l1, l1.length + l2.length);
        System.arraycopy(l2, 0, result, l1.length, l2.length);
        return result;
    }/*w w w.j a v a 2  s  .c om*/
}

Related

  1. concatenate(T[] first, T[] second)
  2. concatenate2Arrays(T[] array1, T... array2)
  3. concatenateArray(Object[] srcOne, Object[] srcTwo)
  4. concatenateArrays(T[] first, T[]... rest)
  5. concatenateStrings(Object[] strings, String glueString)
  6. concatStrings(String[] strs, String delimiter)
  7. concatTwoStringArray(String[] first, String[] second)
  8. concatUniq(String[] part1, String[] part2)
  9. concatUnique(String[] a, String[] b)