ShortBuffer order() Method in Java with Examples Last Updated : 20 Sep, 2018 Comments Improve Suggest changes Like Article Like Report The order() method of java.nio.ShortBuffer is used to retrieve the buffer's byte order. The byte order of a short buffer created by allocation or by wrapping an existing short array is the native order of the underlying hardware. The byte order of a short buffer created as a view of a byte buffer is that of the byte buffer at the moment that the view is created. Syntax: public abstract ByteOrder order() Return Value: The method returns the buffer's byte order. Below programs illustrate the use of order() method: Program 1: Java // Java program to demonstrate // order() method import java.nio.*; import java.util.*; public class GFG { public static void main(String[] args) { // creating short buffer ShortBuffer bb = ShortBuffer.allocate(7); bb.put((short)44); // using the order method System.out.println(bb.order()); } } Output: LITTLE_ENDIAN Comment More infoAdvertise with us Next Article ShortBuffer order() Method in Java with Examples I IshwarGupta Follow Improve Article Tags : Misc Java Java-Functions Java-ShortBuffer Java-NIO package +1 More Practice Tags : JavaMisc Similar Reads ShortBuffer compareTo method in Java with Examples The compareTo() method of java.nio.ShortBuffer class is used to compare one buffer to another. Two short buffers are compared by comparing their sequences of remaining elements lexicographically, without regard to the starting position of each sequence within its corresponding buffer. Pairs of short 4 min read SortedMap put() method in Java with Examples The put() method of SortedMap interface in Java is used to associate the specified value with the specified key in this map. Syntax: V put(K key, V value) Parameters: This method has two arguments: key: which is the left argument and value: which is the corresponding value of the key in the map. Ret 2 min read Stream min() method in Java with Examples Stream.min() returns the minimum element of the stream based on the provided Comparator. A Comparator is a comparison function, which imposes a total ordering on some collection of objects. min() is a terminal operation which combines stream elements and returns a summary result. So, min() is a spec 3 min read SortedMap putAll() method in Java with Examples The putAll() method of SortedMap interface in Java is used to copy all of the mappings from the specified SortedMap to this SortedMap. Syntax: void putAll(Map m) Parameters: This method has the only argument map m which contains key-value mappings to be copied to given SortedMap. Returns: This metho 2 min read Comparator reverseOrder() method in Java with examples The reverseOrder() method of Comparator Interface in Java returns a comparator that use to compare Comparable objects in reverse of natural order. The returned comparator by this method is serializable and throws NullPointerException when comparing null. Syntax: static <T extends Comparable<T 1 min read Like