Example usage for java.lang Character reverseBytes

List of usage examples for java.lang Character reverseBytes

Introduction

In this page you can find the example usage for java.lang Character reverseBytes.

Prototype

@HotSpotIntrinsicCandidate
public static char reverseBytes(char ch) 

Source Link

Document

Returns the value obtained by reversing the order of the bytes in the specified char value.

Usage

From source file:Main.java

public static void main(String[] args) {
    char ch1 = '\u4d00', ch2;

    ch2 = Character.reverseBytes(ch1);

    String str = "Reversing bytes on ch1 gives " + ch2;

    System.out.println(str);// w  ww . j ava 2  s.com
}