Example usage for java.nio LongBuffer array

List of usage examples for java.nio LongBuffer array

Introduction

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

Prototype

public final long[] array() 

Source Link

Document

Returns the long array which this buffer is based on, if there is one.

Usage

From source file:Main.java

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

    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 ww w .  j  ava 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 bb = LongBuffer.wrap(new long[] { 0, 1, 2, 3, 4, 5, 6 });
    bb.put(100);//  w  w w  . j av  a2s . com
    System.out.println(Arrays.toString(bb.array()));

}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100L);//from w  ww. j a  v a 2  s . co 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 bb = LongBuffer.wrap(new long[] { 0, 1, 2, 3, 4, 5, 6 }, 0, 3);
    bb.put(100L);//from  w ww  . jav  a  2  s. co m
    System.out.println(Arrays.toString(bb.array()));

}