title: Appending Integer array elements in Java
body: <p>I have an array, say </p>
  
  <pre><code>int a[]={2,0,1,0,1,1,0,2,1,1,1,0,1,0,1};
  </code></pre>
  
  <p>I need to append each of the 5 neighboring elements and assign them to a new array <code>b</code> with <code>length=(a.length/5);</code> and i want to append the 5 neighboring elements so that I have:
  <code>int b[]={20101,10211,10101};</code> I need to do this for various length arrays, in most cases with length of <code>a</code> being greater than 15. </p>
  
  <p>Any help would be greatly appreciated, I'm programming in Java.</p>
  
  <p>Thanks in advance.</p>