You Are Here:

Community: Developer Discussion Boards

#1 Old Problem with OpenInputStream - 2007-09-09, 10:40

Join Date: Jan 2007
Posts: 17
zidia
Offline
Registered User
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
Reply With Quote

#2 Old Re: Problem with OpenInputStream - 2007-09-09, 11:57

Join Date: Aug 2005
Posts: 44
nimishjain15882
Offline
Registered User
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
Reply With Quote

#3 Old Re: Problem with OpenInputStream - 2007-09-09, 13:37

Join Date: Jan 2007
Posts: 17
zidia
Offline
Registered User
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
Reply With Quote

#4 Old Re: Problem with OpenInputStream - 2007-09-10, 10:37

Join Date: Jan 2007
Posts: 17
zidia
Offline
Registered User
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with eglSwapBuffers and heap corruption greatape Symbian Media (Graphics & Sounds) 2 2007-05-24 04:35
netcards - Problem with opening adapter kernj Symbian Tools & SDKs 5 2007-01-10 09:56
WAP service problem on Apache bigg_o Browsing and Mark-ups 3 2005-04-17 17:05
Problem: S60 SDK for CW in PC with .NET anttij Carbide.c++ IDE and plug-ins 1 2005-02-28 12:36
7210 Silent Problem MarkMckim Mobile Java General 1 2003-03-18 13:36

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ