Example usage for java.nio IntBuffer wrap

List of usage examples for java.nio IntBuffer wrap

Introduction

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

Prototype

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

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.wrap(new int[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 3);
    bb.put(100);/*from w  ww  .  ja va  2 s.  co m*/
    System.out.println(Arrays.toString(bb.array()));

}