Java BufferedImage Load loadImage(byte[] data)

Here you can find the source of loadImage(byte[] data)

Description

load Image

License

Apache License

Declaration

public static BufferedImage loadImage(byte[] data) throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;

import java.io.IOException;
import java.io.InputStream;
import javax.imageio.ImageIO;

public class Main {
    public static BufferedImage loadImage(byte[] data) throws IOException {
        BufferedImage img = null;
        try (InputStream input = new ByteArrayInputStream(data)) {
            img = ImageIO.read(input);
        }//from   w w w  .j  ava 2  s . c  o  m
        return img;
    }
}

Related

  1. loadFromResource(String imageName, Class cls)
  2. loadFromURL(String url)
  3. loadImage(ClassLoader classLoader, String path)
  4. loadImage(File file)
  5. loadImage(File file)
  6. loadImage(File file)