How do I convert a InputStream to BufferedImage in Java/Groovy?

Dycey picture Dycey · Jun 24, 2011 · Viewed 32.8k times · Source

Yes, I'm that stupid. I'm trying to stick some groovy code together from various cookbook recipes, and I can't get from an InputStream to BufferedImage in Java/Groovy. Google is not being my friend at present.

Answer

Gans picture Gans · Jun 24, 2011
BufferedImage imBuff = ImageIO.read(object.getInputStream());

Should work...