Re: Blockingio
- From: "bitshit" <bitshit_at_hot_mail_dot_com>
- Date: Sat, 27 Aug 2005 00:58:26 +0200
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?
"Andrew Thompson" <SeeMySites@xxxxxxxxxxx> schreef in bericht
news:74a1juz5lro2$.13mv6jj8shgs8.dlg@xxxxxxxxxxxxx
> On Fri, 26 Aug 2005 09:20:03 +0200, bit*** wrote:
> ..
>>> ..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?
>
> Well.. I searched Sun, *three* times for any mention
> to what I was referring ..and failed to find *anything*
> that told - the maximum size of a class file.
>
> AFAIU, it it 64Kb, or 65536 bytes.
>
> Sorry, maybe someone else can confirm/correct my statement..
>
> --
> Andrew Thompson
> physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
> "Finely tuned and well adjusted.."
> Do-Re-Mi 'Man Overboard'
I didn't know about the 64kb limit for class files... if I rename my data
zips to .class and let the jvm cache them I dont seem to get any problems
anyway...
I followed the tip they gave to this problem at:
http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_id=4528599
This way, it does cache the data zip. And Im able to load it as a zip file,
but when downloading the .class, the jvm will somehow prevent updating
downloading progress... is it something the jvm does under the hood (in a
sepearte thread or something, that blocks the original inputstream till its
finished)?
.
- Follow-Ups:
- Re: Blockingio
- From: Andrew Thompson
- Re: Blockingio
- References:
- Re:Blockingio
- From: bit***
- Re: Blockingio
- From: Andrew Thompson
- Re:Blockingio
- Prev by Date: Re: A short but unsuccessful script for calling a Java app.
- Next by Date: Re: General Programming tips
- Previous by thread: Re: Blockingio
- Next by thread: Re: Blockingio
- Index(es):