Here you can find the source of byteToString(byte[] bytes)
public static String byteToString(byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { public static String byteToString(byte[] bytes) { char[] chars = new char[bytes.length]; for (int i = 0; i < bytes.length; i++) { chars[i] = (char) bytes[i]; }//from w w w . j av a 2 s . c o m return String.copyValueOf(chars); } }