Here you can find the source of getBytesUtf8(String string)
public static byte[] getBytesUtf8(String string) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static byte[] getBytesUtf8(String string) throws UnsupportedEncodingException { if (string == null) { return null; }/*w w w. j a v a2s .c om*/ return string.getBytes("UTF-8"); } }