Here you can find the source of getBufferedImage(byte[] imageBytes)
public static BufferedImage getBufferedImage(byte[] imageBytes) throws IOException
//package com.java2s; //License from project: Apache License import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.ByteArrayInputStream; import java.io.IOException; public class Main { public static BufferedImage getBufferedImage(byte[] imageBytes) throws IOException { ByteArrayInputStream input = new ByteArrayInputStream(imageBytes); return ImageIO.read(input); }//from w ww . j av a2s. c om }