Here you can find the source of getBytes(String string, String charsetName)
private final static byte[] getBytes(String string, String charsetName)
//package com.java2s; //License from project: Open Source License import java.io.UnsupportedEncodingException; public class Main { private final static byte[] getBytes(String string, String charsetName) { try {//from www .ja v a 2 s . c o m return string.getBytes(charsetName); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; } } }