Here you can find the source of toUTF8Bytes(final String s)
public static byte[] toUTF8Bytes(final String s)
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { public static byte[] toUTF8Bytes(final String s) { try {// w w w.j a va 2s. c om return s.getBytes("UTF-8"); } catch (final UnsupportedEncodingException e) { throw new RuntimeException(e); } } }