×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    17

    Problem with OpenInputStream

    Hi guys, I'm trying to make a connection with a file on memory card but it don't work..

    I'm trying still with the emulator and the code is:

    Code:
                String url="file:///E:/folder1/folder2/data.aaa";
    
                InputStream is = null;
                FileConnection fc = null;
                fc = (FileConnection) Connector.open(url);
                is = fc.openInputStream();
    
                DataInputStream din = new DataInputStream(is);
                System.out.println("aviable: "+din.available());
    I have also tried


    Code:
                String url="file:///E:/folder1/folder2/data.aaa";
    
                InputStream is = Connector.openInputStream(url);
    
                DataInputStream din = new DataInputStream(is);
                System.out.println("aviable: "+din.available());
    or

    Code:
                String url="file:///E:/folder1/folder2/data.aaa";
    
                InputStream is = Connector.openInputStream(url);
    
                System.out.println("aviable: "+is.available());
    The problem is that return always 0!
    What I can try to solve this?

    Thanks

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    44

    Re: Problem with OpenInputStream

    hi

    Have you checked whether the file exists at the following location.
    Which emulator are you using ?

    Try calling exists on the fileconnection before calling isavailable.

    regards
    nimish

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    17

    Re: Problem with OpenInputStream

    I didn't check but there are no exceptions when I call Connector.openInputStream. When I tried whit a wrong url there was some exceptions...
    I use the Carbide's emulator and I putted the files in right directory.

    Thanks

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    17

    Re: Problem with OpenInputStream

    I tried with FileConnection.fileSize() and this return me 38000 bytes.
    It is possible that InputStream can't read this file becouse is an array of bytes?

    Thanks

Similar Threads

  1. Problem with eglSwapBuffers and heap corruption
    By greatape in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2007-05-24, 03:35
  2. netcards - Problem with opening adapter
    By kernj in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-01-10, 08:56
  3. WAP service problem on Apache
    By bigg_o in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2005-04-17, 16:05
  4. Problem: S60 SDK for CW in PC with .NET
    By anttij in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-02-28, 11:36
  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
  •  
×