Example usage for java.nio CharBuffer equals

List of usage examples for java.nio CharBuffer equals

Introduction

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

Prototype

public boolean equals(Object other) 

Source Link

Document

Checks whether this char buffer is equal to another object.

Usage

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  av  a 2 s . c  om*/

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

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

}