Here you can find the source of getUTF8(String data)
private static byte[] getUTF8(String data)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; public class Main { private static byte[] getUTF8(String data) { try {/* w w w.ja v a 2s . com*/ return data.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { return null; } } }