Re:Blockingio



Pete Barrett" <petebarrett@xxxxxxxx> schreef in bericht
news:dg6kg1ddapnmbdu0of920u2jvotrje34rf@xxxxxxxxxx
>>> On Mon, 22 Aug 2005 18:05:49 +0200, "bit***"
>>> <bitshit_at_hot_mail_dot_com> wrote:
>>>
>>>>I made a simple progressbar to show in my applet when I download data. I
>>>>download this data over an URLConnection with the option
>>>>setUseCache(true).
>>>>
>>>>I know that it can't cache any file other than .class files, so i've
>>>>renamed
>>>>my zip data file to .class, so the jvm caches it. This all works fine,
>>>>except that I can't read progress from the input stream when I download
>>>>.class files with setUseCache enabled. When downloading class files with
>>>>setUseCache(false) or other files than .class it works ok. Does anyone
>>>>know
>>>>what's causing this?
>>>>
>>> Isn't this what a cache is all about? That the file is in the cache,
>>> therefore immediately available, therefore no progress to report?
>>>
>>> Pete Barrett

>>true.

>>but the problem is when downloading the file from a url (the first time,
>>not
>>from cache). It just doesn't read any progress, just as if the jvm
>>downloads
>>.class files in some seperate thread i can't access till its done. it just
>>returns the filesize after some time (the time nescesary to download it)


> ..it seems to me that you are opening a hole can of worms
> by attemtping to treat downloadable resources as if they
> were class files.
>
> E.G. What is supposed to happen if any single resource
> is over 64Kb?


Well, actually I have resources in the "Class" file that are over 1mb,
tested it on all JVM's (1.1 to 1.5) and it works =)

What would be wrong with resource files in the class (zip) file over 64KB?



.