output streams using URLConnection

i have simplet applet which downloads a compressed file using URLConnection into an array.

i time how long it takes to download.

i then upload the contents of this array back to the server and time how long it takes.

now this seems to work fine when running this test over cable and adsl, however when

i run it on a 56k modem the upload returns weird results. (example it says it uploaded the

file at 20 kilobytes per second which is just not possibe). when i turn compression

off on the modem it return 5 kilobytes per second which is what i expect.

my question how can i get around this without having to manually turn the compression off on the modem?

the file i download is already heavily compressed.

thanks

[779 byte] By [tester9999] at [2007-9-22]
# 1

Upload a larger file (maybe 100KB), and try to measure the time again.

Why does you complaining about files being sent using a greater speed than expected?

I believe that you're trying to show how much time an upload will take.

If you are measuring connection speed using such method you're out of luck, because it is not reliable. It's better to start the upload not showing the expected "time to completion", and after some minutes, when the speed measuring is more reliable, you can effectively show your estimative for a "time to completion".

Take some previous measurements, and use the mean value.

edsonw at 2007-7-6 > top of java,Java Essentials,Java Programming...
# 2

There is a weird effect if you use Gzip compression.

For those reading this topic: Gzip compresses one single file, appending a .gz after the full filename:

for instance readme.txt.gz. The problem with Gzip is that the decompressed size is not known

in advance.

On a server-to-client download (the more natural way), your browser will say something like

"time to finish: unknown" and give a download speed, based on the decompression, possibly

higher than the line is physically able to.

Measurement of down/uploading an already compressed file (like a JPEG) will yield more

realistic numbers.

joop_eggen at 2007-7-6 > top of java,Java Essentials,Java Programming...
# 3
Hello,I'm experiencing the same problem. My upload results are much too high. Have you found any answers to your question since your original post?Thanks,Ryan
ogaard at 2007-7-6 > top of java,Java Essentials,Java Programming...
# 4
isn't there something with modems that they cache certain things so that if the same file goes back and forth, it doesn't need to transmit the entire thing each time?
bsampieri at 2007-7-6 > top of java,Java Essentials,Java Programming...
# 5

> i have simplet applet which downloads a compressed

> file using URLConnection into an array.

> i time how long it takes to download.

> i then upload the contents of this array back to the

> server and time how long it takes.

>

> now this seems to work fine when running this test

> over cable and adsl, however when

> i run it on a 56k modem the upload returns weird

> results. (example it says it uploaded the

> file at 20 kilobytes per second which is just not

> possibe). when i turn compression

> off on the modem it return 5 kilobytes per second

> which is what i expect.

>

> my question how can i get around this without having

> to manually turn the compression off on the modem?

> the file i download is already heavily compressed.

>

> thanks

Does anyone have a solution or fix to this problem?

Any new info. or direction is greatly appreciated!

Ryan

ogaard at 2007-7-6 > top of java,Java Essentials,Java Programming...