We need to control the Bandwidth of transfer the file.
Bandwidth means if we transfer the file with size 1000kb.We want to transfer the file by 20kb/sec.
We can try to do that by using Thread in the following way,
We transfer the 20kb data.Then check the time if it takes less than 1 sec,We wait until the time is reach one second by the sleep method.
We can achieve it.But the transfer graph shows the lot of ups and downs.
But they need to transfer the data mutually.That is,the graph is not vary so much.
Is there any way to do this in java?