I want to save an image data into a file via FileOutputStream and restore back as needed through FileInputStream, such as :
Save :
int[] data;
BufferedImage.getRGB(0, 0, w,h, data, 0, w);
Save data via FileOutputStream
Restore:
Get data back via FileInputStream
BufferedImage.setRGB(0, 0, w,h, data, 0, w);
The problem is both FileInputStream and FileOutputStream require byte[] not int[]. How can I convert int[] to bye[] and visa efficiently or Java has something allow you to save buffered image data into a file and restore back as needed ?
Jay