Here you can find the source of bytesToCharset(final byte[] bytes, final String charset)
public static String bytesToCharset(final byte[] bytes, final String charset)
//package com.java2s; //License from project: Open Source License public class Main { public static String bytesToCharset(final byte[] bytes, final String charset) { try {/*from w ww .java 2s .co m*/ return new String(bytes, charset); } catch (Exception e) { e.printStackTrace(); } return null; } }