DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 1 of 1
  1. #1
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560

    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 !!!
    Last edited by sjalle; 05-28-2005 at 09:19 PM. Reason: Even more havock !!!
    eschew obfuscation

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links