1
0
-1

将 BufferedImage 对象转换为  InputStream 的方法。

    Comment Add your comment...

1 answer

  1. 2
    1
    0

    例如可以使用下面的代码:

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    ImageIO.write(bufferedImage, "png", baos);
    InputStream is = new ByteArrayInputStream(baos.toByteArray());


    重要的方法为:

    InputStream is = new ByteArrayInputStream(baos.toByteArray());

      Comment Add your comment...