public String encode ( String value ) { if ( value == null ) { return null ; } StringBuilder buffer = new StringBuilder ( ) ; buffer . append ( Prefix ) ; buffer . append ( charset ) ; buffer . append ( Sep ) ; buffer . append ( getEncoding ( ) ) ; buffer . append ( Sep ) ; buffer . append ( new String ( Base64 . encode ( value . getBytes ( charset ) ) ) ) ; buffer . append ( Postfix ) ; return buffer . toString ( ) ; }
Encodes a string into its Base64 form using the default charset . Unsafe characters are escaped .