I am trying to convert my BufferedImage into a integer array, but i am getting the following error: "java.awt.image.DataBufferByte cannot be cast to java.awt.image.DataBufferInt"
Here's my bit of code:
public class Test {
public static void main (String [] args) {
BufferedImage img = null;
try {
img = ImageIO.read(new File("G.bmp"));
} catch (IOException e) { }
int[] imgarray = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
}
}