Convert byte To Char - Android java.lang

Android examples for java.lang:Character

Description

Convert byte To Char

Demo Code


//package com.java2s;

public class Main {
    public static char byteToChar(byte[] b) {
        char c = (char) (((b[0] & 0xFF) << 8) | (b[1] & 0xFF));
        return c;
    }//  w  ww  . j  a  v a  2  s  .  c  om
}

Related Tutorials