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
最新推荐文章于 2024-07-16 04:52:49 发布