Example usage for java.util Arrays toString

List of usage examples for java.util Arrays toString

Introduction

In this page you can find the example usage for java.util Arrays toString.

Prototype

public static String toString(Object[] a) 

Source Link

Document

Returns a string representation of the contents of the specified array.

Usage

From source file:Main.java

public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);

    bb.put(98765);/*from  w w  w.j  a  v a 2 s  . c o  m*/

    DoubleBuffer bb1 = bb.compact();

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

}

From source file:Main.java

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

    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) {
    DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);

    bb.put(98765);//from w  w  w .j a  va2 s  .com

    DoubleBuffer bb1 = bb.duplicate();

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

}

From source file:Main.java

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

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.compact();

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

}

From source file:Main.java

public static void main(String[] args) {
    IntBuffer intBuffer = IntBuffer.allocate(10);
    intBuffer.put(100);// w  w  w.ja  v a2s . c om

    intBuffer.rewind();

    IntBuffer intBuffer2 = intBuffer.asReadOnlyBuffer();

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

}

From source file:Main.java

public static void main(String[] args) {
    DoubleBuffer bb = DoubleBuffer.allocate(BSIZE);

    bb.put(98765);//from  w  w w.  j  a  v  a 2 s.c o m

    DoubleBuffer bb1 = bb.compact();

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

    System.out.println(bb.compareTo(bb1));

}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putInt(123);// w w  w .j a v a 2s .  c om

    System.out.println(Arrays.toString(bbuf.array()));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putLong(123);/*www  .ja v  a2 s.  co m*/

    System.out.println(Arrays.toString(bbuf.array()));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putChar('a');

    System.out.println(Arrays.toString(bbuf.array()));
}

From source file:Main.java

public static void main(String[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putFloat(123F);/*from  w  w w.j  av a  2  s.  c o m*/

    System.out.println(Arrays.toString(bbuf.array()));
}