Here you can find the source of bytesToChar(byte[] b)
public static char bytesToChar(byte[] b)
//package com.java2s; //License from project: Apache License public class Main { public static char bytesToChar(byte[] b) { char c = (char) ((b[0] << 8) & 0xFF00L); c |= (char) (b[1] & 0xFFL); return c; }//from ww w . j a v a 2 s.c o m }