×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jan 2008
    Posts
    272

    Thumbs up InputStream problem

    Hi,

    I am writing a player application.

    For that I am using input stream.

    My code looks like this:
    try
    {
    Fileconnection fc = (FileConnection)Connector.open(mediafileLoc);
    InputStream is = fc.openInputStream();
    Player p = Manager.createPlayer(is,null);
    p.prefetch();
    p.realize();
    p.start();
    }
    catch(Exception e)
    {
    //showing alert
    }

    its working fine on first time. when I closed and tried to play the same song I got an exception:"File is used by the application".
    When closing the player I wrote like this:
    try
    {
    p.closePlayer();
    is.close();
    is = null;
    fc.close();
    fc = null;
    }

    catch(Exception e)
    {
    //showing alert
    }


    What might be the problem?

    can you please help me.

    Thanks,
    Manoj.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: InputStream problem

    Uhm...

    are you sure you're not getting an Exception when trying to close your Player/Stream/FileConnection instances?

    Since you define all these instances locally to your previous try/catch block, they're not accessible from outside it (and this should be the reason of your error message).

    Hope it helps,
    Pit

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

    Re: InputStream problem

    hi Jappit,

    Thanks for your reply.

    The problem get resolved.

    Thanks,
    Manoj.

Similar Threads

  1. problem in reading from bluetooth inputstream
    By aluckybird in forum Bluetooth Technology
    Replies: 13
    Last Post: 2010-05-17, 15:53
  2. Problem in creating image from InputStream
    By deepanjanghosh16 in forum Mobile Java General
    Replies: 1
    Last Post: 2006-12-19, 12:47
  3. About 6230 Bt Problem
    By eerkek in forum Bluetooth Technology
    Replies: 17
    Last Post: 2005-02-08, 12:33
  4. Inputstream read method is blocking
    By gnhansen in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-09-29, 14:44
  5. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36

Posting Permissions

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