原帖已删除
Ta的回复 :File file = new File("E:/0754.jpg"); System.out.println(file.isFile() +"==="+ file.exists()); byte[] bytes1 = FileUtil.readFileByBytes("E:/0754.jpg"); System.out.println(bytes1.length); String image1 = Base64Util.encode(bytes1); 楼主,我用这个工具类,文件是存在的,不过有些图片进行base64编码之后什么都没返回。在代码 case 0: currentByte = (char) (from[i] & lead6byte); currentByte = (char) (currentByte >>> 2); 这里 currentByte 是个?号,然后就跳出循环了。是对图片有什么要求吗?