Here you can find the source of getStringForByte(byte[] bs)
public static String getStringForByte(byte[] bs)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static String getStringForByte(byte[] bs) { if (bs == null) return ""; try {/*from ww w . jav a 2 s . co m*/ return new String(bs, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return ""; } }