Java Array Merge mergeArrays(T[] items, T[]... added)

Here you can find the source of mergeArrays(T[] items, T[]... added)

Description

add all added arrays to items

License

Apache License

Parameter

Parameter Description
items a parameter
added a parameter

Declaration

public static <T> void mergeArrays(T[] items, T[]... added) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from   w w  w  .  ja  v  a 2  s  .c o  m*/
     * add all added arrays to items
     * @param items
     * @param added
     */
    public static <T> void mergeArrays(T[] items, T[]... added) {
        int index = 0;
        for (int i = 0; i < added.length; i++) {
            T[] item = added[i];
            System.arraycopy(item, 0, items, index, item.length);
            index += item.length;
        }
    }
}

Related

  1. mergeArrays(String[] a, String[] b)
  2. mergeArrays(String[] a1, String[] a2)
  3. mergeArrays(String[] array, String[] newEntries)
  4. mergeArrays(String[] data1, String[] data2)
  5. mergeArrays(String[] inputArray1, String[] inputArray2)
  6. mergeArrays(T[] lhs, T[] rhs)
  7. MergeArrays(T[]... arrs)
  8. mergeArrayToString(final String[] array)
  9. mergeByArray(int[] a, int[] b)