IntBuffer order() in Java

order(): This method is available in java.nio.IntBuffer class of Java.

Syntax:

ByteOrder java.nio.IntBuffer.order()

This method retrieves this buffer's byte order.

Parameters: NA

Returns: This buffer's byte order.

Exceptions: NA

Approach

Java

import java.nio.IntBuffer;

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

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

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

Output:

LITTLE_ENDIAN


No comments:

Post a Comment