Example usage for java.nio ShortBuffer allocate

List of usage examples for java.nio ShortBuffer allocate

Introduction

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

Prototype

public static ShortBuffer allocate(int capacity) 

Source Link

Document

Creates a short buffer based on a newly allocated short array.

Usage

From source file:Main.java

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put(new short[] { 100, 123 });
    System.out.println(bb.arrayOffset());

}

From source file:Main.java

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

}

From source file:Main.java

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

}

From source file:Main.java

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

}

From source file:Main.java

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

}

From source file:Main.java

public static void main(String[] args) {
    ShortBuffer bb = ShortBuffer.allocate(10);
    bb.put(new short[] { 100, 123, 123, 123, 1 }, 0, 1);
    System.out.println(bb.toString());

}

From source file:Main.java

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

}

From source file:Main.java

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

    bb.rewind();//from  ww  w  .ja  v  a2  s .c om
    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();/*  w w  w  . j  ava2  s  .c om*/
    System.out.println(bb.get(0));

}