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.
Asked
Active
Viewed 4.1k times
30
-
I see your Google-foo is lacking Dycey-san. You must practice and make your sensei proud! – Möoz Oct 06 '14 at 01:26
1 Answers
90
BufferedImage imBuff = ImageIO.read(object.getInputStream());
Should work...

Gans
- 1,000
- 7
- 5
-
2as I already had a stream variable, it was as simple as `BufferedImage imBuff = ImageIO.read(myInputStrVar);`. Yes, I am stupid! – Dycey Jun 24 '11 at 08:07
-
7
-
1note: do not close the stream, InputStream will not be null but imagebuffer will be a null. close it after the conversion. – 3xCh1_23 Feb 05 '16 at 20:46