Java IO Tutorial - Java ShortBuffer.put(short[] src)








Syntax

ShortBuffer.put(short[] src) has the following syntax.

public final ShortBuffer put(short[] src)

Example

In the following code shows how to use ShortBuffer.put(short[] src) method.

import java.nio.ShortBuffer;
/*w ww  .j av  a 2s . com*/
public class Main {
  public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put(new short[]{100,123});
    System.out.println(bb.arrayOffset());

  }
}

The code above generates the following result.