Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    14

    Question Getting IOException while reading image

    Hi All,

    Im developing a application in which im reading file system.

    I wrote two classes in one class i read all images and made thumbnails. In this class image get read properly. In second class again i read same image and try to upload it on server.

    Im facing problem in second class while reading that file. I got exception as

    "java.io.IOException: failed to open file for reading"

    The code for reading the fileas in both classes is same. Still Im getting exeception in reading file.

    Plz anybody know why it is happening.

    Plz help me out.

    Thanks

  2. #2
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Re: Getting IOException while reading image

    Quote Originally Posted by renuka_anil View Post
    Hi All,

    Im developing a application in which im reading file system.

    I wrote two classes in one class i read all images and made thumbnails. In this class image get read properly. In second class again i read same image and try to upload it on server.

    Im facing problem in second class while reading that file. I got exception as

    "java.io.IOException: failed to open file for reading"

    The code for reading the fileas in both classes is same. Still Im getting exeception in reading file.

    Plz anybody know why it is happening.

    Plz help me out.

    Thanks

    I think you haven't properly closed the fileconncetions in the first class. First close all fileConnections, InputStream in first class, and open the fileConncetion in second class.

  3. #3
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Getting IOException while reading image

    Hello renuka_anil,

    in addition to the advice by manojkumar.m, in case the problem still persists, could you please provide the code to this thread for others to review for finding the possible cause of the problem?

    Regards,
    r2j7

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    158

    Re: Getting IOException while reading image

    Hi,

    Make sure you are closing() the file after first read and before opening the same file again. The current File handles are very limited and hence releasing them properly is very essential.

    Regards,
    Raja Nagendra Kumar,
    C.T.O
    www.tejasoft.com

Similar Threads

  1. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 07:34
  2. how to cut some part of Image
    By mshouab in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-08-04, 09:05
  3. HELP: Mutable Image to Immutable Image?
    By rj_cybersilver in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-03-26, 10:58
  4. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 16:31
  5. Loading Image data from 'raw' bytes
    By LongSteve in forum Mobile Java General
    Replies: 2
    Last Post: 2002-11-20, 18:38

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×