Here you can find the source of toUTF8(byte[] bytes)
Parameter | Description |
---|---|
bytes | a parameter |
public static String toUTF8(byte[] bytes)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { /**//from ww w . j ava 2 s. com * Convert to UTF-8 bytes * * @param bytes * @return */ public static String toUTF8(byte[] bytes) { assert bytes != null; String str = null; try { str = new String(bytes, "utf-8"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { } return str; } }