Here you can find the source of getString(byte[] bytes, String charsetName)
public static String getString(byte[] bytes, String charsetName)
//package com.java2s; import java.nio.charset.Charset; public class Main { public static String getString(byte[] bytes, String charsetName) { return new String(bytes, Charset.forName(charsetName)); }//from ww w . j av a 2 s. co m public static String getString(byte[] bytes) { return getString(bytes, "GBK"); } }