Posted By:
Stephen_Ostermiller
Posted On:
Monday, February 4, 2002 11:06 AM
I would implement this by keeping a count of the number of bytes that you have written and read so far. Also keep a variable that has the time that you started reading or writing.
From these two you can computer your data rate. If your data rate is too high just sleep for a while.
You will need the following functions:
System.currentTimeMillis()
Thread.sleep()
It should be fairly easy to calculate how long you would need to sleep to bring your data rate down to the level you desire.