Example usage for java.nio ShortBuffer wrap

List of usage examples for java.nio ShortBuffer wrap

Introduction

In this page you can find the example usage for java.nio ShortBuffer wrap.

Prototype

public static ShortBuffer wrap(short[] array, int start, int len) 

Source Link

Document

Creates a new short buffer by wrapping the given short array.

Usage

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.wrap(new short[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 3);
    bb.put((short) 100);
    System.out.println(Arrays.toString(bb.array()));

}