title: android bytebuffer as intbuffer - asarray always gives unsupportedoperationexception
body: <p>I'm trying to grab a set of mipmaplevels and save to a local cache file to avoid rebuilding them each time (and it is not practical to pre-generate them...)</p>
  
  <p>I've got the mipmaplevels into a set of bitmaps OK, and now want to write them to my cache file, but whatever variety of buffer I use (direct or not, setting byteorder or not) hasArray always comes back false on the intbuffer.  I must be doing something silly here, but I can't see the wood for the trees anymore.</p>
  
  <p>Not been using java for long, so this is prolly a noob error ;)</p>
  
  <p>Code looks like this:</p>
  
  <pre><code>  int tsize = 256;
    ByteBuffer xbb = ByteBuffer.allocate(tsize*tsize*4);
    // or any other variety of create like wrap etc. makes no diference
    xbb.order(ByteOrder.nativeOrder()); // in or out - makes no difference
    IntBuffer ib = xbb.asIntBuffer();
    for (int i = 0; i &lt; tbm.length; i++) {
      //ib.array() throws exception, ib.hasArray() returns false;
      tbm[i].getPixels(ib.array(), 0, tsize, 0, 0, tsize, tsize);
      ou.write(xbb.array(), 0, tsize*tsize*4);
      tsize = tsize / 2;
    }
  </code></pre>