Here you can find the source of fromByteArray(byte[] byteArray)
public static BufferedImage fromByteArray(byte[] byteArray) throws IOException
//package com.java2s; //License from project: Open Source License import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; public class Main { public static BufferedImage fromByteArray(byte[] byteArray) throws IOException { return ImageIO.read(new ByteArrayInputStream(byteArray)); }// w w w . j a v a 2 s. co m }