BufferedImage转换InputStream

  • Post author:
  • Post category:其他


            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());



版权声明:本文为he_lei原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。