Convert a image Base64 to jpg image

//https://github.com/jai-imageio/jai-imageio-core byte[] imageByte = Base64.decodeBase64(image); BufferedImage imageIO = ImageIO.read(new ByteArrayInputStream(imageByte)); OutputStream output = new ByteArrayOutputStream(); ImageIO.write(imageIO, "jpg", output); InputStream file = new ByteArrayInputStream(((ByteArrayOutputStream) output).toByteArray());

1 Response

Esse "image" que entra na linha 2 é a imagem em base64 já?

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.