Android Byte Array Concatenate concat(byte[] base, byte... extension)

Here you can find the source of concat(byte[] base, byte... extension)

Description

concat

Declaration

public static byte[] concat(byte[] base, byte... extension) 

Method Source Code

//package com.java2s;

public class Main {
    public static int[] concat(int[] base, int... extension) {
        int[] compound = new int[base.length + extension.length];
        System.arraycopy(base, 0, compound, 0, base.length);
        System.arraycopy(extension, 0, compound, base.length,
                extension.length);/*from ww w. j  a va  2s  .  c o  m*/
        return compound;
    }

    public static byte[] concat(byte[] base, byte... extension) {
        byte[] compound = new byte[base.length + extension.length];
        System.arraycopy(base, 0, compound, 0, base.length);
        System.arraycopy(extension, 0, compound, base.length,
                extension.length);
        return compound;
    }
}

Related

  1. concat(byte[] a, byte[] b)
  2. concat(int[] base, int... extension)
  3. concatByteArray(byte[] a, byte[] b)
  4. copyBytesIntoByteArray(byte[] dest, byte[] src)
  5. copyBytesIntoByteArrayAtOffset(byte[] dest, byte[] src, int offset)