Here you can find the source of ByteArrayToString(byte[] input)
public static String ByteArrayToString(byte[] input)
//package com.java2s; import java.nio.charset.Charset; public class Main { public static String ByteArrayToString(byte[] input) { if (input == null) return null; else/* w w w . ja v a 2 s . c om*/ return new String(input, Charset.forName("utf-8")); } }