ThrottledInputStream throttledInputStream = new ThrottledInputStream(otherIputStream, new ThrottleSemaphore(1024));
Usage over multiple {@link InputStream}s:
//throttle the read of multiple input streams at the rate of 1024 bytes/sec
ThrottleSemaphore semaphore = new ThrottleSemaphore(1024);
ThrottledInputStream throttledInputStream1 = new ThrottledInputStream(otherIputStream1, semaphore);
ThrottledInputStream throttledInputStream2 = new ThrottledInputStream(otherIputStream2, semaphore);
...
|
|