CharBuffer order() methods in Java with Examples
The order() method of java.nio.CharBuffer class is used to retrieve this buffer’s byte order. The byte order of a char buffer created by allocation or by wrapping an existing char array is the native order of the underlying hardware. The byte order of a char buffer created as a view of a byte buffer is that of the byte buffer at the moment that the view is created.
public abstract ByteOrder order()
Return Value: This method returns this buffer’s byte order.
Below are the examples to illustrate the order() method:
CharBuffer is : [a, b, c, d] Order: LITTLE_ENDIAN
CharBuffer is : [,,, ] Order: LITTLE_ENDIAN