java combine byte array byte[]

java combine byte array byte[]
refer to‮l:‬autturi.com
/**
 * @author lautturi.com
 * Java example: how to combine two byte array in java
 */

import java.util.*;

public class Lautturi {

	public static void main(String[] args) {

		byte[] bytes1 = {104, 101, 108, 108, 111, 32};
		byte[] bytes2 = {108, 97, 117, 116, 116, 117, 114, 105, 32, 106, 97, 118, 97, 33};

		byte[] combined = new byte[bytes1.length + bytes2.length];

		System.arraycopy(bytes1,0,combined,0            ,bytes1.length);
		System.arraycopy(bytes2,0,combined,bytes1.length,bytes2.length);
		
		System.out.println(Arrays.toString(combined));
	}
}

output:

[104, 101, 108, 108, 111, 32, 108, 97, 117, 116, 116, 117, 114, 105, 32, 106, 97, 118, 97, 33]
Created Time:2017-09-20 13:48:33  Author:lautturi