Here you can find the source of fromByteArray(byte[] data)
public static BufferedImage fromByteArray(byte[] data) throws IOException
//package com.java2s; //License from project: Apache License import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; import javax.imageio.ImageIO; public class Main { public static BufferedImage fromByteArray(byte[] data) throws IOException { ByteArrayInputStream inputStream = new ByteArrayInputStream(data); return ImageIO.read(inputStream); }//from w ww. ja v a2 s. c o m }