?
Solved

How to detect Internet speed ??

Posted on 2002-05-19
3
Medium Priority
?
191 Views
Last Modified: 2011-09-20
I have a pure java program and it will downlod some file from server. When it download files from server, simetime it will take long time if files size is big. I plan to use JProgressBar to show user the progress. But I have a problem to calculate the total time for download. Actually I have below two question:
1) how to detect the Internet speed
2) how to get file size in server side--suppose I have URL for file in server side.

If I can handle above two problems, I can get total download time. Then I can use JProgressBar. Tahnks
gary
0
Comment
Question by:garyshi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 7020554
> 1) how to detect the Internet speed

The only way to get this is to calculate it by tracking the number of bytes recieved and the time taken to recieve them. And even then it is only an estimate, plus it's always changing.

> 2) how to get file size in server side--suppose I have
> URL for file in server side.

Try using getCOntentLength() method of URLConnection.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8766861
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to objects@idg

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question