You Are Here:

Community: Developer Discussion Boards

#1 Old Size of a resource - 2005-03-16, 17:35

Join Date: May 2004
Posts: 4
zavagoo
Offline
Registered User
Hello,

i have a question concerning the size of a resource file.

I'm trying to open a file containing large amount of data, by using inpustream.

The file is pretty big: 49k. But i was planning to use even bigger file: 100 k if needed...

when i want to access the data in the file, i use a datainpustream over an inpustream.

i thought that by this way, i would be able to access data byte by byte without loading all the file in memory, and so the size of the file would'nt matter.

but actually it seems that the file is totally loaded in memory anyway, and i get out of memory pretty quickly.

Is there a way to access data of a file little by little, without loading all the file in memory?
Can i control the size of the part of the file i can load in memory?

thx in advance.
Reply With Quote

#2 Old 2005-03-17, 01:49

Join Date: Aug 2003
Posts: 232
Location: uk
Send a message via ICQ to alex_crowther
alex_crowther's Avatar
alex_crowther
Offline
Regular Contributor
Most (probably all) j2me implimentations load the whole file into memory when you open it.

If you are thinking, thats abit pointless, why give the programmer functions to read the file byte by byte if you have already loaded the whole file into memory .. you would be right :)

It wouldn't be so bad if you could access the file once its loaded into memory, but no, you have to allocate more memory and copy the file into your memory before you can actually use it ...

I imagine there is some technical reason why phones do this (possibly the programmers were just lazy) .. who knows ..
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

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