Here you can find the source of getString(byte[] bytes, String charset)
public static String getString(byte[] bytes, String charset)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; public class Main { public static String getString(byte[] bytes, String charset) { try {//from ww w.j av a2s . com return new String(bytes, charset); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } public static String getString(byte[] bytes, Charset charset) { return new String(bytes, charset); } }