Java tutorial
//package com.java2s; public class Main { public static String newString(byte[] b, String charset) { try { return new String(b, charset); } catch (Exception e) { return null; } } }