CharBuffer
inherits that method from the Buffer
interface, with many others.
CharBuffer
has multiple sub-classes

For example the DirectCharBuffer
(s) return true
.
This
ByteBuffer.allocateDirect(20).asCharBuffer();
will return a DirectCharBuffer
, which is a CharBuffer
.
*U
suffix for big-endian systems.
*S
suffix for other kinds (little-endian).
*R
suffix for read-only buffers.
final CharBuffer cb = ByteBuffer.allocateDirect(20).asCharBuffer();
final boolean direct = cb.isDirect(); // true
Is this so and is it the only (and recommended) way to do it?
Yes.
For reference, what is a direct buffer? See JavaDoc, section Direct vs. non-direct buffers.