Java IO Tutorial - Java FloatBuffer.arrayOffset()








Syntax

FloatBuffer.arrayOffset() has the following syntax.

public final int arrayOffset()

Example

In the following code shows how to use FloatBuffer.arrayOffset() method.

import java.nio.FloatBuffer;
/*from   ww w  .ja  v  a2s.c  o  m*/
public class Main {
  public static void main(String[] args) {
    FloatBuffer floatBuffer = FloatBuffer.allocate(10);
    
    floatBuffer.put(0,1.23F);
    
    floatBuffer.rewind();
    
    System.out.println(floatBuffer.arrayOffset());

  }
}

The code above generates the following result.