Here you can find the source of getBytes(String string, Charset charset)
private static byte[] getBytes(String string, Charset charset)
//package com.java2s; //License from project: Apache License import java.nio.charset.Charset; public class Main { private static byte[] getBytes(String string, Charset charset) { return string == null ? null : string.getBytes(charset); }//from w w w . j a v a2 s.com }