List of utility methods to do Byte Array to BufferedImage
BufferedImage | byteArrayToBufferedImage(byte[] array) Convert byte array to BufferedImage InputStream in = new ByteArrayInputStream(array); BufferedImage bImageFromConvert = ImageIO.read(in); return bImageFromConvert; |
BufferedImage | byteArrayToBufferedImage(byte[] image) byte Array To Buffered Image InputStream in = new ByteArrayInputStream(image); return ImageIO.read(in); |
BufferedImage | byteArrayToImage(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()); ... |
BufferedImage | byteArrayToImage(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; |
BufferedImage | bytesToImage(byte[] buf) Converts the provided byte buffer into an BufferedImage ByteArrayInputStream bais = new ByteArrayInputStream(buf); return ImageIO.read(bais); |
BufferedImage | bytesToImage(byte[] imageData) Converts a byte array into an image. return ImageIO.read(new ByteArrayInputStream(imageData)); |
BufferedImage | bytesToImage(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); ... |
BufferedImage | byteToBufferedImage(byte[] buff) byte To Buffered Image return ImageIO.read(new ByteArrayInputStream(buff)); |
BufferedImage | byteToBufferedImage(byte[] imgBytes) byte To Buffered Image InputStream in = new ByteArrayInputStream(imgBytes); BufferedImage bImageFromConvert = ImageIO.read(in); return bImageFromConvert; |
BufferedImage | bytesToBufferedImage(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; |