title: divide array in to sub arrays java 8
body: <p>I have an array like 1,2,3,4
   need to divide into </p>
  
  <pre><code>int [] array = { 1, 2, 3 , 4}
  
  for( int i= 0; i &lt; array .length-0; i ++) {
    Integer[] intArrays = array .stream().toArray(Integer[]::new);
   //processing with stream
  }
  
  
  123, 234,34,4
  sum of the each grouping 
  1+2+3 =6
  2+3+4 = 9
  3+4 = 7
  4=4
  </code></pre>
  
  <p>I can do it from java traditional way but need to implement  using java 8 stream concept</p>
  
  <p>can you help me to do that</p>