In this tutorial, you will see how to use of isDirect() method of ShortBuffer class in java.
In this tutorial, you will see how to use of isDirect() method of ShortBuffer class in java.In this tutorial, we will check short buffer is direct or not. If direct memory is allocated their memory address is fixed for the lifetime of the buffer.
ShortBuffer API:
The java.nio.ShortBuffer class extends java.nio.Buffer class. It provides the following methods:
Return type | Method | Description |
static ShortBuffer | wrap(short[] array) | The wrap(...) method create a short buffer by wrapping the associated short array. |
abstract boolean | isDirect() | The isDirect() method tells whether this associated buffer is direct or not. |
import java.nio.*;
|
C:\>java DirectShortBuffer Short buffer is not direct. Short buffer is direct. |