outputstream to image js example

Solutions on MaxInterview for outputstream to image js example by the best coders in the world

showing results for - "outputstream to image js example"
Erika
01 May 2019
1<img src="data:image/png;base64,[ENCODED STRING GOES HERE]">
Emelie
30 Jan 2017
1// Java side
2BufferedImage image = ImageIO.read(new File("helloworld.png"));
3ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
4ImageIO.write(image, "png", outputStream);
5String encodedImage = Base64.encode(outputStream.toByteArray());
6
7// js side
8<img src="data:image/png;base64,[ENCODED STRING GOES HERE]">