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, int start, int end) 

Source Link

Document

Writes chars of the given CharSequence to the current position of this buffer, and increases the position by the number of chars written.

Usage

From source file:Main.java

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

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

}