What is the correct way to create buffer?


Code :
 
ByteBuffer floatBuf = ByteBuffer.allocateDirect(vertex.length * 4);
floatBuf.order(ByteOrder.ntaiveOrder());
vBuf = floatBuf.asFloatBuffer();
vBuf.put(vertex);
vBuf.position(0);


Some tutorials also do like this

Code :
 
cubeVertexBfr[i]=FloatBuffer.wrap(vertices);


What's the difference?