Here you can find the source of loadImageFromBytes(byte[] bytes)
public static Image loadImageFromBytes(byte[] bytes)
//package com.java2s; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; import javax.imageio.ImageIO; public class Main { public static Image loadImageFromBytes(byte[] bytes) { try {/* www .j a v a 2 s . com*/ ByteArrayInputStream is = new ByteArrayInputStream(bytes); BufferedImage image = ImageIO.read(is); is.close(); return image; } catch (IOException e) { throw new RuntimeException(e); } } }