LongBuffer isDirect() in Java

isDirect(): This method is available in java.nio.LongBuffer class of Java.

Syntax:

boolean java.nio.LongBuffer.isDirect()

This method tells whether or not this long buffer is direct.

Parameters: NA

Returns: true if, and only if, this buffer is direct.

Exceptions: NA

Approach

Java

import java.nio.LongBuffer;

public class LongBufferisDirect {
    public static void main(String[] args) {

        long array[] = { 1, 2, 3, 4 };
        LongBuffer lb = LongBuffer.wrap(array);

        System.out.println(lb.isDirect());
    }
}

Output:

false


No comments:

Post a Comment