Here you can find the source of decodeString(String s, String encoding)
public static byte[] decodeString(String s, String encoding)
//package com.java2s; //License from project: Apache License import java.io.UnsupportedEncodingException; public class Main { public static byte[] decodeString(String s, String encoding) { if (s == null) return null; try {/*from w w w . j a v a 2 s .c o m*/ return s.getBytes(encoding); } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported encoding " + encoding, e); } } }