ByteArrayOutputStream outStream = new ByteArrayOutputStream();
outStream.write(byte_1);
outStream.write(byte_2);
byte[] mass = outStream.toByteArray();
byte[] mass = new byte[byte_1.length() + byte_2.length()]
System.arrayCopy(byte_1, 0, mass, 0, byte_1.length());
System.arrayCopy(byte_2, 0, mass, byte_1.length(), byte_2.length());
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>