Java FloatBuffer.get(float[] dst)

Syntax

FloatBuffer.get(float[] dst) has the following syntax.

public FloatBuffer get(float[] dst)

Example

In the following code shows how to use FloatBuffer.get(float[] dst) method.


import java.nio.FloatBuffer;
import java.util.Arrays;
/*from   w  w  w.j  a  v a  2  s .c  o m*/
public class Main {
  public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);
    
    floatBuffer.put(0,1.23F);
    
    floatBuffer.rewind();
    
    float[] floatArray = new float[10];
    
    floatBuffer.get(floatArray);
    
    System.out.println(Arrays.toString(floatArray));

  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.nio »




Buffer
ByteBuffer
ByteOrder
CharBuffer
DoubleBuffer
FloatBuffer
IntBuffer
LongBuffer
MappedByteBuffer
ShortBuffer