标签:
怎样将BufferedImage转成InputStream
public InputStream getImageStream(BufferedImage bimage){ InputStream is = null; ByteArrayOutputStream bs = new ByteArrayOutputStream(); ImageOutputStream imOut; try { imOut = ImageIO.createImageOutputStream(bs); ImageIO.write(bimage, "png",imOut); is= new ByteArrayInputStream(bs.toByteArray()); } catch (IOException e) { e.printStackTrace(); } return is; }
标签:
原文地址:http://www.cnblogs.com/hzzhero/p/5115222.html