Here you can find the source of getBytesUnchecked(String string, String charsetName)
public static byte[] getBytesUnchecked(String string, String charsetName)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; public class Main { public static byte[] getBytesUnchecked(String string, String charsetName) { if (string == null) { return null; } else {// w ww . j av a 2s . c om try { return string.getBytes(charsetName); } catch (UnsupportedEncodingException var3) { throw newIllegalStateException(charsetName, var3); } } } private static byte[] getBytes(String string, Charset charset) { return string == null ? null : string.getBytes(charset); } private static IllegalStateException newIllegalStateException(String charsetName, UnsupportedEncodingException e) { return new IllegalStateException(charsetName + ": " + e); } }