Use System.arraycopy instead of Arrays.copyOf for compability

Arrays.copyOf needs api level 9