Here you can find the source of decode(String string, boolean decode)
public static String decode(String string, boolean decode)
//package com.java2s; //License from project: Apache License import javax.xml.bind.DatatypeConverter; import java.io.UnsupportedEncodingException; public class Main { public static String decode(String string, boolean decode) { return decode ? decode(string) : string; }//from w ww . j a v a2s.com public static String decode(String string) { if (string != null) { try { byte[] decoded = DatatypeConverter.parseBase64Binary(string); return new String(decoded, "UTF-8"); } catch (UnsupportedEncodingException e) { } } return string; } }