title: Java: System.arraycopy is not copying my arrays
body: <p>I have an array called "first" and another array called "second", both arrays are of type byte and size of 10 indexes. </p>
  
  <p>I am copying the two arrays into one array called "third" of type byte too and of length 2*first.length as follow:</p>
  
  <pre><code>byte[] third= new byte[2*first.length];
  for(int i = 0; i&lt;first.length;i++){
      System.arraycopy(first[i], 0, third[i], 0, first.length);
      }   
  for(int i = 0; i&lt;second.length;i++){
      System.arraycopy(second[i], 0, third[i], first.length, first.length);
      }
  </code></pre>
  
  <p>but it is not copying and it throws an exception: ArrayStoreException</p>
  
  <p>I read on the <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/System.html" rel="nofollow">here</a> that this exception is thrown when an element in the src array could not be stored into the dest array because of a type mismatch. but all my arrays are in bytes so there is no mismatch </p>
  
  <p>what exactly is the problem ?</p>