I have an object of type BufferedImage
that I am filled with a screenshot using AWT
BufferedImage imagexd = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
I get the image correctly in the object but now I want to store it in the machine.
I already knew how to store this type of data with OutputStream.write
asi
( OutputStream out = new FileOutputStream("ruta");
out.write(bytes);
)
The problem is that it receives a byte array (byte []) and buffered image does not have any method to obtain this (at least for what it investigates), so my question is how can I get the byte [] of that BufferedImage ?