Here you can find the source of bytesToString(byte[] data)
private static String bytesToString(byte[] data)
//package com.java2s; public class Main { private static String bytesToString(byte[] data) { char[] cs = new char[data.length]; for (int i = 0; i != cs.length; i++) { cs[i] = (char) (data[i] & 0xff); }/* w w w . j a va 2 s . c o m*/ return new String(cs); } }