String filePath ="D:\\Alivin\\Temp\\img\\c.jpg"; byte[] b = Files.readAllBytes(Paths.get(filePath)); String s = Base64.getEncoder().encodeToString(b);
String filePath ="D:\\Alivin\\Temp\\img\\c.jpg"; byte[] b = Files.readAllBytes(Paths.get(filePath)); String s = Base64.getEncoder().encodeToString(b);
转载于:https://www.cnblogs.com/SunAutumn/p/9669513.html