title: Why FloatBuffer instead of float[]?
body: <p>I've been using FloatBuffers in my Android code for a while (copied it from some opengles tutorial), but I cannot understand exactly what this construct is and why it is needed.</p>
  
  <p>For example this code (or similar) I see in many many peoples' code and android tutorials:</p>
  
  <pre><code>float[] vertices = ...some array...
  
  ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4); 
  vbb.order(ByteOrder.nativeOrder());    // use the device hardware's native byte order
  FloatBuffer fb = vbb.asFloatBuffer();  // create a floating point buffer from the ByteBuffer
  fb.put(vertices);    // add the coordinates to the FloatBuffer
  fb.position(0);      // set the buffer to read the first coordinate
  </code></pre>
  
  <p>This seems awfully verbose and messy for something which as far as I can tell is just a fancy wrapper around of an array of floats.</p>
  
  <p>Questions: </p>
  
  <ul>
  <li><p>What is the justification for this type of class (ByteBuffer, FloatBuffer), as opposed to any other kind of collection or simple array of floats?</p></li>
  <li><p>What's the idea behind creating a ByteBuffer before converting it into a FloatBuffer? </p></li>
  </ul>