public static byte [ ] decodeBase64 ( String base64 ) { if ( base64 == null ) throw new NullPointerException ( "Parameter 'base64' cannot be null." ) ; String fixedBase64 = padBase64 ( base64 ) ; return Base64 . getDecoder ( ) . decode ( fixedBase64 ) ; }
Decodes a base64 - encoded string padding out if necessary .