//Contents in a non-direct ByteBuffer are stored in the normal memory.
//Contents in a direct ByteBuffer are stored in some I/O device.
import java.nio.ByteBuffer;
publicclass Main {
publicstaticvoid main(String[] argv) throws Exception {
ByteBuffer bbuf = ByteBuffer.wrap(newbyte[10]);
boolean isDirect = bbuf.isDirect(); // false
bbuf = ByteBuffer.allocate(10);
isDirect = bbuf.isDirect(); // false
bbuf = ByteBuffer.allocateDirect(10);
isDirect = bbuf.isDirect(); // true
}
}