Here you can find the source of getImage(byte[] bytes)
public static BufferedImage getImage(byte[] bytes)
//package com.java2s; //License from project: Open Source License import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; import javax.imageio.ImageIO; public class Main { public static BufferedImage getImage(byte[] bytes) { try {/*from ww w . j a va 2 s.com*/ return ImageIO.read(new ByteArrayInputStream(bytes)); } catch (IOException e) { throw new RuntimeException(e); } } }