Map<String,String> queryMap = new HashMap<>();
queryMap.put("name","jay.star");
String jsonStr = JSON.toJSONString(queryMap);// 转成json com.alibaba.fastjson
byte[] bytes = jsonStr.getBytes(StandardCharsets.ISO_8859_1);// 转成byte数组
String encodeData = new String(android.util.Base64.encode(bytes, android.util.Base64.NO_WRAP));// 转成Base64
System.out.println("base64:" + encodeData);
byte[] decode = android.util.Base64.decode(encodeData, Base64.NO_WRAP);// 解码
String s = new String(decode);// byte[]转字符串
System.out.println("decode base64:"+s);