Here you can find the source of fromUTF8Bytes(byte[] bytes)
public static String fromUTF8Bytes(byte[] bytes)
//package com.java2s; /*/* www . j ava 2s . c om*/ * Copyright (C) 2009 by Eric Herman <eric@freesa.org> * Use and distribution licensed under the * GNU Lesser General Public License (LGPL) version 2.1. * See the COPYING file in the parent directory for full text. */ import java.io.UnsupportedEncodingException; public class Main { public static final String CHARSET_UTF_8 = "UTF-8"; public static String fromUTF8Bytes(byte[] bytes) { return fromBytes(bytes, CHARSET_UTF_8); } public static String fromBytes(byte[] bytes, String encoding) { if (bytes == null) { return null; } try { return new String(bytes, encoding); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException("Runtime does not support" + " encoding " + encoding, e); } } }