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[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putFloat(2, 123F);//from w  ww  .  j  a  v a  2  s  .  c o 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.putDouble(2, 123);/*from  ww w .  j a v a 2  s. c  o m*/

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

From source file:Main.java

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

    longBuffer.rewind();

    LongBuffer longBuffer2 = longBuffer.asReadOnlyBuffer();

    System.out.println(Arrays.toString(longBuffer2.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.putShort((short) 123);

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

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  .  co  m*/

    short[] shortArray = new short[10];
    bb.get(shortArray, 0, 2);

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

}

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.putShort(2, (short) 123);

    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.putShort(2, (short) 123);
    System.out.println(Arrays.toString(bbuf.array()));

    System.out.println(bbuf.isDirect());
}

From source file:Main.java

public static void main(String[] args) {
    LongBuffer bb = LongBuffer.allocate(10);
    bb.put(100L);//from www  . j a va  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[] argv) throws Exception {
    ByteBuffer bbuf = ByteBuffer.allocate(10);
    int capacity = bbuf.capacity(); // 10
    System.out.println(capacity);
    bbuf.putShort(2, (short) 123);
    System.out.println(Arrays.toString(bbuf.array()));

    System.out.println(bbuf.position());
}

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.put("java2s.com".getBytes());
    System.out.println(Arrays.toString(bbuf.array()));
}