Java CharBuffer.isDirect()
Syntax
CharBuffer.isDirect() has the following syntax.
public abstract boolean isDirect()
Example
In the following code shows how to use CharBuffer.isDirect() method.
import java.nio.CharBuffer;
//from w ww .jav a 2 s . c o m
public class Main {
public static void main(String[] args) {
CharBuffer cb1 = CharBuffer.allocate(50);
cb1.append("java2s.com");
cb1.rewind();
System.out.println(cb1.isDirect());
}
}
The code above generates the following result.