2

Having -

FloatBuffer floatBuffer  = FloatBuffer.allocate(SIZE)

how could I get its float[SIZE] ?

Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147
URL87
  • 10,667
  • 35
  • 107
  • 174

3 Answers3

3

FloatBuffer.array() should return you the float array

2

To get the float[] array backed by the buffer just call the method array() :

float[] arrayBuff = floatBuffer.array();
Alexis C.
  • 91,686
  • 21
  • 171
  • 177
0

You can use the FloatBuffer#get(float[] dst) method to copy the underlying array to a new destination array.

Konstantin Yovkov
  • 62,134
  • 8
  • 100
  • 147