Example usage for java.nio ShortBuffer rewind

List of usage examples for java.nio ShortBuffer rewind

Introduction

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

Prototype

public final Buffer rewind() 

Source Link

Document

Rewinds this buffer.

Usage

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short) 100);

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short) 100);

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short) 100);

    bb.rewind();

    short[] shortArray = new short[10];
    bb.get(shortArray);//  w  w  w .  ja  va2s.co m

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short) 100);

    bb.rewind();

    short[] shortArray = new short[10];
    bb.get(shortArray, 0, 2);//from w w w.  ja v  a2 s .com

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put((short) 100);

    bb.rewind();

    ShortBuffer shortBuffer2 = ShortBuffer.allocate(10);

    shortBuffer2.put(bb);// w  ww  .  j a  va 2  s  .c  o  m

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();

    ShortBuffer shortBuffer2 = shortBuffer.compact();

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();

    ShortBuffer shortBuffer2 = shortBuffer.compact();

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();

    ShortBuffer shortBuffer2 = shortBuffer.duplicate();

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();

    ShortBuffer shortBuffer2 = shortBuffer.slice();

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer shortBuffer = ShortBuffer.allocate(10);
    shortBuffer.put((short) 100);

    shortBuffer.rewind();

    ShortBuffer shortBuffer2 = shortBuffer.asReadOnlyBuffer();

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

}