title: DataInputStream from a MappedByteBuffer
body: <p>I wonder if it is possible to create DataInputStream backed by a MappedByteBuffer instance ?</p>
  
  <pre><code>MappedByteBuffer buff = (initialize...);
  ByteArrayInputStream bis = new ByteArrayInputStream(buff.array());
  </code></pre>
  
  <p>This code snippet throws <a href="http://www.google.com/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;ved=0CG8QFjAA&amp;url=http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/UnsupportedOperationException.html&amp;ei=IX4bULD0OOmn4gTnoYDoAw&amp;usg=AFQjCNGpz54HJPh7w5G3b6LLuk10FHPVaQ" rel="nofollow">UnsupportedOperationException</a> because mapped byte buffer is not backed by an accessible array.</p>
  
  <p>Then I tried to load bytes to pyhsical memory by calling <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/nio/MappedByteBuffer.html#load%28%29" rel="nofollow">load</a> method by it is no use.</p>
  
  <p>Any suggestions ?</p>