Here you can find the source of asUTF8bytes(String s)
public static byte[] asUTF8bytes(String s)
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static byte[] asUTF8bytes(String s) { try {//from w ww . j ava 2 s. com return s.getBytes("UTF-8"); } catch (UnsupportedEncodingException ex) { throw new InternalError("UTF-8 not supported!"); } } }