Whats wrong with ImageIO ??
In my efforts to become a modern java programmer I have started using
ImageIO to load images into my aplications. So I've left the old ways;
using FileInputStream - reading bytes - using toolKit to make image -
and closing the stream.
Well, when using this method
Code:
BufferedImage img=ImageIO.read(File f);
..there is no ways of closing the inputfile, so one should assume that this
ImageIO.read -method had the brains to close the file, but apparently it
doesn't.
Program crashes occurs during application development, but beware: if you
have used this ImageIO to load image files, and your program crashes, then
don't be surprised if the images are GONE !!
:( :( :(
Newsflash;
I tried with this approach:
Code:
File f = new File(cp+"\\dgame\\images\\" + fileName);
FileInputStream in=new FileInputStream(f);
diceImages[j] = ImageIO.read(in);
in.close();
And now the entire "images" folder is gone, including the backupfolder at
"images\\backup"
Until someone can explain this to me I will never touch ImageIO ever again !!!