FloatBuffer: position() : FloatBuffer « java.nio « Java by API






FloatBuffer: position()

 
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;

public class Main {
  public static void main(String[] args) {
    ByteBuffer bb = ByteBuffer.wrap(new byte[] { 0, 0, 0, 0, 0, 0, 0, 'a' });
    bb.rewind();
    FloatBuffer fb = ((ByteBuffer) bb.rewind()).asFloatBuffer();
    System.out.println("Float Buffer");
    while (fb.hasRemaining())
      System.out.println(fb.position() + " -> " + fb.get());

  }
}

   
  








Related examples in the same category

1.FloatBuffer: get()
2.FloatBuffer: hasRemaining()
3.FloatBuffer: put(float f)