Java ShortBuffer.array()
Syntax
ShortBuffer.array() has the following syntax.
public final short[] array()
Example
In the following code shows how to use ShortBuffer.array() method.
import java.nio.ShortBuffer;
import java.util.Arrays;
/* w w w. j av a2 s . c o m*/
public class Main {
public static void main(String[] args) {
ShortBuffer bb = ShortBuffer.wrap(new short[] { 0, 1, 2, 3, 4, 5, 6 });
bb.put((short)100);
System.out.println(Arrays.toString(bb.array()));
}
}
The code above generates the following result.