Example usage for java.nio CharBuffer append

List of usage examples for java.nio CharBuffer append

Introduction

In this page you can find the example usage for java.nio CharBuffer append.

Prototype

public CharBuffer append(CharSequence csq) 

Source Link

Document

Writes all chars of the given character sequence csq to the current position of this buffer, and increases the position by the length of the csq.

Usage

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from  w  ww  . j ava2  s. c  o m*/

    System.out.println(cb1.hasArray());
}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();// w ww.j  a  va  2 s .  c  o  m

    System.out.println(cb1.toString());
}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from   w ww.  ja v a 2 s  .c  om*/

    System.out.println(cb1.hashCode());
}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from  w w w. java  2 s  .co m*/

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

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(5);
    cb1.append('j');
    cb1.rewind();//from w ww .  j  a v a2  s  .  c  om

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

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from w  w  w .ja va2s  .c o m*/

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

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from   w  w  w.jav a2 s.c  om*/

    System.out.println(cb1.charAt(2));
    System.out.println(Arrays.toString(cb1.array()));

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*  ww w.  j av  a 2  s . c  o  m*/

    System.out.println(cb1.arrayOffset());
    System.out.println(Arrays.toString(cb1.array()));

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();/*from   ww w  . j a va  2s . co  m*/

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

    CharBuffer cb2 = cb1.slice();
    System.out.println(cb2.equals(cb1));

}

From source file:Main.java

public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(50);
    cb1.append("java2s.com");
    cb1.rewind();//from  ww w.j  a va2  s  .  c om

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

    CharBuffer cb2 = cb1.slice();
    System.out.println(cb2.compareTo(cb1));

}