Java IO Tutorial - Java ShortBuffer.arrayOffset()








Syntax

ShortBuffer.arrayOffset() has the following syntax.

public final int arrayOffset()

Example

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

import java.nio.ShortBuffer;
//from   w w w  .j av  a  2s .co m
public class Main {
  public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short)100);
    System.out.println(bb.arrayOffset());

  }
}

The code above generates the following result.