Here you can find the source of resolveToEmojiFromByte(String str)
public static String resolveToEmojiFromByte(String str)
//package com.java2s; //License from project: Open Source License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static String resolveToEmojiFromByte(String str) { Pattern pattern2 = Pattern.compile("<:([[-]\\d*[,]]+):>"); Matcher matcher2 = pattern2.matcher(str); StringBuffer sb3 = new StringBuffer(); while (matcher2.find()) { matcher2.appendReplacement(sb3, resolveToEmoji(matcher2.group(0))); }/*from w w w .j ava 2 s . c om*/ matcher2.appendTail(sb3); return sb3.toString(); } private static String resolveToEmoji(String str) { str = str.replaceAll("<:", "").replaceAll(":>", ""); String[] s = str.split(","); byte[] b = new byte[s.length]; for (int i = 0; i < s.length; i++) { b[i] = Byte.valueOf(s[i]); } return new String(b); } }