class ArrayUtils {

  public static byte[] concat(final byte[] left, final byte[] right) {
    if (null == left && null == right) {
      return new byte[0];
    }
    if (null == left) {
      return Arrays.copyOf(right, right.length);
    }
    if (null == right) {
      return Arrays.copyOf(left, left.length);
    }
    final byte[] concated = new byte[left.length + right.length];
    System.arraycopy(left, 0, concated, 0, left.length);
    System.arraycopy(right, 0, concated, left.length, right.length);
    return concated;
  }

}