BufferedImage bi = (BufferedImage) dicom.getImage();
ByteArrayOutputStream os = new ByteArrayOutputStream();
String imagePath = format + ".jpg";
ImageIO.write(bi, "jpg", os);
// ImageIO.write(bi, "jpg", new File(imagePath));
// File file = new File(imagePath);
// inputStream = new FileInputStream(file);
inputStream = new ByteArrayInputStream(os.toByteArray());
BufferedImage转换InputStream
最新推荐文章于 2022-11-10 17:24:27 发布