Here you can find the source of toUnicodeString(char[] chars)
public static String toUnicodeString(char[] chars)
//package com.java2s; //License from project: Open Source License public class Main { public static String toUnicodeString(char[] chars) { StringBuffer strBuf = new StringBuffer(); for (int i = 0; i < chars.length; i++) { strBuf.append("\\u").append(Integer.toHexString(chars[i])); }/* w ww . j a v a 2 s . com*/ return strBuf.toString(); } public static String toString(Object object) { return toString(object, null); } public static String toString(Object object, String defaultValue) { if (object == null) return defaultValue; return String.valueOf(object); } }