Java IO Tutorial - Java ShortBuffer.put(short[] src, int offset, int length)








Syntax

ShortBuffer.put(short[] src, int offset, int length) has the following syntax.

public ShortBuffer put(short[] src,  int offset,  int length)

Example

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

/*from   www .  j  a v  a2  s  . co m*/
import java.nio.ShortBuffer;

public class Main {
  public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put(new short[]{100,123,123,123,1},0,1);
    System.out.println(bb.toString());

  }
}

The code above generates the following result.