Here you can find the source of byteArrayToBufferedImage(byte[] image)
public static BufferedImage byteArrayToBufferedImage(byte[] image) throws IOException
//package com.java2s; /**/* w w w . j av a2s . c om*/ * Copyright (c) 2014 Sa?l Pi?a <sauljabin@gmail.com>, Jorge Parra <thejorgemylio@gmail.com>. * <p> * This file is part of SimulationP3DX. * <p> * SimulationP3DX is licensed under The MIT License. * For full copyright and license information please see the LICENSE file. */ import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.*; public class Main { public static BufferedImage byteArrayToBufferedImage(byte[] image) throws IOException { InputStream in = new ByteArrayInputStream(image); return ImageIO.read(in); } }