Java Utililty Methods Byte Array to BufferedImage

List of utility methods to do Byte Array to BufferedImage

Description

The list of methods to do Byte Array to BufferedImage are organized into topic(s).

Method

BufferedImagebyteArrayToBufferedImage(byte[] array)
Convert byte array to BufferedImage
InputStream in = new ByteArrayInputStream(array);
BufferedImage bImageFromConvert = ImageIO.read(in);
return bImageFromConvert;
BufferedImagebyteArrayToBufferedImage(byte[] image)
byte Array To Buffered Image
InputStream in = new ByteArrayInputStream(image);
return ImageIO.read(in);
BufferedImagebyteArrayToImage(byte[] imagebytes)
Ein Image aus einem byte-Array (BLOB) erzeugen
try {
    if (imagebytes != null && (imagebytes.length > 0)) {
        BufferedImage im = ImageIO.read(new ByteArrayInputStream(imagebytes));
        return im;
    return null;
} catch (IOException e) {
    throw new IllegalArgumentException(e.toString());
...
BufferedImagebyteArrayToImage(byte[] imageData)
byte Array To Image
BufferedImage image = null;
if (imageData == null) {
    return null;
image = ImageIO.read(new ByteArrayInputStream(imageData));
if (image == null) {
    throw new Exception("La imagen no se puede leer");
return image;
BufferedImagebytesToImage(byte[] buf)
Converts the provided byte buffer into an BufferedImage
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
return ImageIO.read(bais);
BufferedImagebytesToImage(byte[] imageData)
Converts a byte array into an image.
return ImageIO.read(new ByteArrayInputStream(imageData));
BufferedImagebytesToImage(byte[] imageData)
Converts a byte array into an image.
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image toolkitImage = toolkit.createImage(imageData);
int width = toolkitImage.getWidth(null);
int height = toolkitImage.getHeight(null);
toolkitImage = toolkitImage.getScaledInstance(width, height, Image.SCALE_FAST);
BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
Graphics g = img.getGraphics();
g.drawImage(toolkitImage, 0, 0, null);
...
BufferedImagebyteToBufferedImage(byte[] buff)
byte To Buffered Image
return ImageIO.read(new ByteArrayInputStream(buff));
BufferedImagebyteToBufferedImage(byte[] imgBytes)
byte To Buffered Image
InputStream in = new ByteArrayInputStream(imgBytes);
BufferedImage bImageFromConvert = ImageIO.read(in);
return bImageFromConvert;
BufferedImagebytesToBufferedImage(final byte[] imageData)
Converts an image as an array of bytes to a BufferedImage
if (imageData == null) {
    throw new IllegalArgumentException("Image data may not be null");
try (ByteArrayInputStream imageInputStream = new ByteArrayInputStream(imageData)) {
    final BufferedImage bufferedImage = ImageIO.read(imageInputStream);
    if (bufferedImage == null) {
        throw new IOException("Image data is corrupt or in an unknown format");
    return bufferedImage;