Here you can find the source of fromUTF8(byte[] bytes)
public static String fromUTF8(byte[] bytes)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.io.UnsupportedEncodingException; public class Main { /**//from ww w . j a v a 2s.c om * Converts the passed byte array to a string, using UTF-8 encoding, and * turning the checked exception (which should never happen) into a runtime * exception. * <p> * If passed <code>null</code>, returns an empty string. */ public static String fromUTF8(byte[] bytes) { try { if (bytes == null) return ""; return new String(bytes, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 not supported", e); } } }