public static FloatBuffer createFloatBuffer(float[] coords){
  ByteBuffer bb=ByteBuffer.allocateDirect(coords.length * SIZEOF_FLOAT);
  bb.order(ByteOrder.nativeOrder());
  FloatBuffer fb=bb.asFloatBuffer();
  fb.put(coords);
  fb.position(0);
  return fb;
}

public static FloatBuffer createFloatBuffer ( float [ ] coords ) { ByteBuffer bb = ByteBuffer . allocateDirect ( coords . length * SIZEOF_FLOAT ) ; bb . order ( ByteOrder . nativeOrder ( ) ) ; FloatBuffer fb = bb . asFloatBuffer ( ) ; fb . put ( coords ) ; fb . position ( 0 ) ; return fb ; }
allocates a direct float buffer , and populates it with the float array data .
