Java IO Tutorial - Java CharBuffer.order()








Syntax

CharBuffer.order() has the following syntax.

public abstract ByteOrder order()

Example

In the following code shows how to use CharBuffer.order() method.

import java.nio.CharBuffer;
/*from   www .  ja  v a  2  s  . co m*/
public class Main {
  public static void main(String[] args) {
    CharBuffer cb1 = CharBuffer.allocate(5);
    cb1.put(2,'j');
    cb1.rewind();

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

The code above generates the following result.