InputStream
into a BufferedImage
as part of a JUnit test. The solution was quite simple using ImageIO
.
Code
1 2 3 4 5 6 7 | public BufferedImage convertInputStreamToBufferedImage( final InputStream is) throws IOException { BufferedImage image = null ; if (is != null ) { image = ImageIO.read(is); } return image; } |
0 comments :
Post a Comment