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
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.
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.
> 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