public byte[] lookRwqdPicture(Integer id) throws IOException {
CheckPicture pic = checkPictureServiceImpl.getById(id);
if (!ObjectUtils.isEmpty(pic.getName())) {
Path path = Paths.get(pic.getZpfwqlj(), pic.getName());
File file = new File(String.valueOf(path));
byte[] bytes = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
BufferedImage bi;
bi = ImageIO.read(file);
// ImageIO.write(bi, "png", baos);
ImageIO.write(bi, pic.getName().split("\.")[1], baos);
bytes = baos.toByteArray();
} catch (Exception e) {
e.printStackTrace();
} finally {
baos.close();
}
return bytes;
} else {
return null;
}
}