Java tutorial
//package com.java2s; import java.io.ByteArrayOutputStream; public class Main { public static byte[] concatByteArrays(byte[] a, byte[] b) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); outputStream.write(a); outputStream.write(b); return outputStream.toByteArray(); } catch (Exception e) { return null; } } }