Here you can find the source of getBytes(String str)
private static byte[] getBytes(String str) throws UnsupportedEncodingException
//package com.java2s; import java.io.UnsupportedEncodingException; public class Main { private static final String CHARSET = "UTF-8"; private static byte[] getBytes(String str) throws UnsupportedEncodingException { return str.getBytes(CHARSET); }//from w w w .j ava 2 s .c om }