摘要: 上一篇说到图片如何转换成base64编码字符串,那么如果反过来呢,代码如下: 1 public static void writeByBase64(String str) { 2 3 String pathImage = "存放图片的路径/xxx.png"; 4 File fileImage = n 阅读全文
posted @ 2021-02-25 15:56 安宇 阅读(2134) 评论(0) 推荐(0)
摘要: 1 public static void readToBase64() { 2 String path = "图片路径"; 3 byte[] byt = null; 4 File file = new File(path); 5 try { 6 byt = FileUtils.readFileToB 阅读全文
posted @ 2021-02-25 15:53 安宇 阅读(406) 评论(0) 推荐(0)
摘要: 1 获取随机数 2 public static String getSerialNo(int len) { 3 String[] baseString = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", 阅读全文
posted @ 2021-02-25 15:44 安宇 阅读(196) 评论(0) 推荐(0)
摘要: Map<String, Object> map = new HashMap<String, Object>(); map.put("a", "a"); map.put("b", "123"); JSONObject json = new JSONObject(map); 阅读全文
posted @ 2021-02-25 14:41 安宇 阅读(488) 评论(0) 推荐(0)