Java Array Concatenate concat(byte[] first, byte[] second)

Here you can find the source of concat(byte[] first, byte[] second)

Description

concat

License

Open Source License

Declaration

public static byte[] concat(byte[] first, byte[] second) 

Method Source Code


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

import java.util.Arrays;

public class Main {
    public static byte[] concat(byte[] first, byte[] second) {
        if (first == null)
            return second;
        if (second == null)
            return first;

        byte[] result = Arrays.copyOf(first, first.length + second.length);
        System.arraycopy(second, 0, result, first.length, second.length);
        return result;
    }//w ww .j  a  v  a 2s .  com
}

Related

  1. arrayConcatenate(String[] first, String[] second)
  2. arrayConcatInt(final int[] original, final int[] appender)
  3. concat(boolean[] a, boolean[] b)
  4. concat(boolean[]... arys)
  5. concat(byte[] a, byte[]... b)
  6. concat(byte[] first, byte[] second)
  7. concat(byte[]... arrays)
  8. concat(double[] first, double[] second)
  9. concat(final T[] elements, final T... elementsToAppend)