title: How to copy IntBuffer into int[]
body: <p>While working with off heap buffers one might want to copy them into array.
  Let's assume we don't know if buffer is off or on heap. 
  How to fill the implementation?</p>
  
  <pre><code>IntBuffer b = ... // could be off or on -heap
  int[] array = toArray(b)
  
  public int[] toArray(IntBuffer b) {
      //???
  }
  </code></pre>