@Test public void base64Decode() { String str1 = "MTIzNDU2"; String str2 = new String(DataUtil.base64Decode(str1)); Assert.equals(str2, "123456", ErrorCodeDef.SYSTEM_ERROR_10001); }
public static byte[] base64Decode(final String content) { try { return Base64.decodeBase64(content.getBytes(GlobalConstants.DEFAULT_CHARSET)); } catch (UnsupportedEncodingException e) { throw new UtilException(ErrorCodeDef.BASE64_ERROR_10037, e); } }
DataUtil { public static byte[] base64Decode(final String content) { try { return Base64.decodeBase64(content.getBytes(GlobalConstants.DEFAULT_CHARSET)); } catch (UnsupportedEncodingException e) { throw new UtilException(ErrorCodeDef.BASE64_ERROR_10037, e); } } }
DataUtil { public static byte[] base64Decode(final String content) { try { return Base64.decodeBase64(content.getBytes(GlobalConstants.DEFAULT_CHARSET)); } catch (UnsupportedEncodingException e) { throw new UtilException(ErrorCodeDef.BASE64_ERROR_10037, e); } }  }
DataUtil { public static byte[] base64Decode(final String content) { try { return Base64.decodeBase64(content.getBytes(GlobalConstants.DEFAULT_CHARSET)); } catch (UnsupportedEncodingException e) { throw new UtilException(ErrorCodeDef.BASE64_ERROR_10037, e); } }  static String md5For16(final String msg); static String md5(final String msg); static byte[] base64Decode(final String content); static String base64Encode(final byte[] content); static String encryptPassowrd(final String rawPassword); static boolean matchPassword(final CharSequence rawPassword, final String password); static String encrypt(final String password); static String decrypt(final String password); static String byte2HexStr(final byte[] bs); static byte[] hexStr2Byte(final String hex); }
DataUtil { public static byte[] base64Decode(final String content) { try { return Base64.decodeBase64(content.getBytes(GlobalConstants.DEFAULT_CHARSET)); } catch (UnsupportedEncodingException e) { throw new UtilException(ErrorCodeDef.BASE64_ERROR_10037, e); } }  static String md5For16(final String msg); static String md5(final String msg); static byte[] base64Decode(final String content); static String base64Encode(final byte[] content); static String encryptPassowrd(final String rawPassword); static boolean matchPassword(final CharSequence rawPassword, final String password); static String encrypt(final String password); static String decrypt(final String password); static String byte2HexStr(final byte[] bs); static byte[] hexStr2Byte(final String hex);  }