private byte[] concat(final byte[] data1, final byte[] data2) {
    final byte[] newdata = new byte[data1.length + data2.length];

    System.arraycopy(data1, 0, newdata, 0, data1.length);
    System.arraycopy(data2, 0, newdata, data1.length, data2.length);

    return newdata;
  }
Concatenates two byte arrays.

@param data1 The first byte array.
@param data2 The second byte array.
@return The concatenated byte array.
@throws NullPointerException Thrown if either of the two source arrays is null.
java/zylib/src/main/java/com/google/security/zynamics/zylib/general/memmanager/Memory.java