Example usage for java.nio IntBuffer rewind

List of usage examples for java.nio IntBuffer rewind

Introduction

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

Prototype

public final Buffer rewind() 

Source Link

Document

Rewinds this buffer.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);/*www . j  a  v  a  2 s . c  o  m*/

    bb.rewind();
    System.out.println(bb.get());

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);//from  w ww. ja v a  2s . co m

    bb.rewind();
    System.out.println(bb.get(0));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);/*from w  w  w.  j  av a 2 s  .c o  m*/

    bb.rewind();

    int[] intArray = new int[10];
    bb.get(intArray);

    System.out.println(Arrays.toString(intArray));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);/*ww  w  .ja v a 2  s  .  c om*/

    bb.rewind();

    int[] intArray = new int[10];
    bb.get(intArray, 0, 2);

    System.out.println(Arrays.toString(intArray));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer bb = IntBuffer.allocate(10);
    bb.put(100);//from  w w w  . ja va  2  s .c  o  m

    bb.rewind();

    IntBuffer intBuffer2 = IntBuffer.allocate(10);

    intBuffer2.put(bb);

    System.out.println(Arrays.toString(intBuffer2.array()));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);//w  w w .j  a v  a  2s  .  co m

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.asReadOnlyBuffer();

    System.out.println(Arrays.toString(intBuffer2.array()));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);/*from ww  w  .j av a 2  s  . co m*/

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.duplicate();

    System.out.println(intBuffer2.equals(intBuffer2));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);// ww  w  . j av a 2 s . c om

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.compact();

    System.out.println(intBuffer2.compareTo(intBuffer2));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);//  www  . j ava2  s .  co m

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.slice();

    System.out.println(intBuffer2.equals(intBuffer2));

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);//from  w ww.  j a v a 2s . co  m

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.compact();

    System.out.println(intBuffer2.equals(intBuffer2));

}