Here you can find the source of decode(String encoding, byte[] bytes)
public static String decode(String encoding, byte[] bytes) throws UnsupportedEncodingException
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static String decode(String encoding, byte[] bytes) throws UnsupportedEncodingException { if (encoding == null) { return new String(bytes, "UTF-8"); } else {/*from w w w . j a v a 2 s .c o m*/ return new String(bytes, encoding); } } }