CharBuffer.wrap(CharSequence csq) has the following syntax.
public static CharBuffer wrap(CharSequence csq)
In the following code shows how to use CharBuffer.wrap(CharSequence csq) method.
import java.nio.CharBuffer; // w ww .jav a 2s.co m public class Main { public static void main(String[] args) { CharBuffer cb1 = CharBuffer.wrap("java2s.com"); System.out.println(cb1.toString()); } }
The code above generates the following result.