Here you can find the source of str(byte[] bytes, String charset)
public static String str(byte[] bytes, String charset)
//package com.java2s; //License from project: Apache License import java.nio.charset.Charset; public class Main { public static String str(Object... objs) { StringBuilder sb = new StringBuilder(); for (Object obj : objs) { sb.append(obj);/*from w ww . j a v a 2 s .c o m*/ } return sb.toString(); } public static String str(byte[] bytes, String charset) { return new String(bytes, Charset.forName(charset)); } }