Here you can find the source of getUtf8Bytes(String s)
public static byte[] getUtf8Bytes(String s)
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static byte[] getUtf8Bytes(String s) { try {/*from w w w. j a v a2s. c o m*/ return s.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException("UTF-8 not found.", e); } } }