Android Array Concatenate concatAll(T[] first, T[]... rest)

Here you can find the source of concatAll(T[] first, T[]... rest)

Description

concat All

Declaration

public static <T> T[] concatAll(T[] first, T[]... rest) 

Method Source Code

//package com.java2s;

import java.util.Arrays;

public class Main {
    public static <T> T[] concatAll(T[] first, T[]... rest) {
        int totalLength = first.length;
        for (T[] array : rest) {
            totalLength += array.length;
        }//from ww w.  j  av  a  2s  .  c  o  m
        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;
    }
}

Related

  1. concat(byte[] first, byte[]... rest)
  2. cancat(byte[] a, byte[] b)
  3. arrayApend(byte[] prep, byte after)
  4. arrayComb(byte[] prep, byte[] after)
  5. concat(T[] a, T[] b)
  6. concatenate(byte[]... bytes)
  7. concat(T[] first, T[] second)
  8. concat(byte[] b1, byte[] b2)
  9. append(byte[] pck1, byte[] pck2)