Example usage for java.nio LongBuffer rewind

List of usage examples for java.nio LongBuffer rewind

Introduction

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

Prototype

public final Buffer rewind() 

Source Link

Document

Rewinds this buffer.

Usage

From source file:Main.java

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

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

}

From source file:Main.java

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

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

}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100);//  w w  w .ja  v a 2  s . com

    bb.rewind();

    long[] longArray = new long[10];
    bb.get(longArray, 0, 2);

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

}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100);//from www.  j  a  v  a 2 s . co  m

    bb.rewind();

    long[] longArray = new long[10];
    bb.get(longArray);

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

}

From source file:Main.java

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

    bb.rewind();

    LongBuffer longBuffer2 = LongBuffer.allocate(10);

    longBuffer2.put(bb);

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

}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer longBuffer = LongBuffer.allocate(10);
    longBuffer.put(100);/*from   ww  w  . j  av a2 s . c o  m*/

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.compact();

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

}

From source file:Main.java

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

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.asReadOnlyBuffer();

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

}

From source file:Main.java

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

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.compact();

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

}

From source file:Main.java

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

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.slice();

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

}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer longBuffer = LongBuffer.allocate(10);
    longBuffer.put(100);// ww w.  ja va 2 s . com

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.duplicate();

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

}