fix off-by-one mistake with integer arithmetic so RecordingInputStreamTest.testReadFullyOrUntil() test passes (how does this pass on master?)

This commit is contained in:
Noah Levitt
2013-08-09 15:39:42 -07:00
parent 750a688670
commit 805331fcbe
@@ -306,8 +306,8 @@ public class RecordingOutputStream extends OutputStream {
if(duration>timeoutMs) {
throw new RecorderTimeoutException();
}
// need to throttle reading to hit max configured rate?
if(position/duration > maxRateBytesPerMs) {
// need to throttle reading to hit max configured rate?
if(position/duration >= maxRateBytesPerMs) {
long desiredDuration = position / maxRateBytesPerMs;
try {
Thread.sleep(desiredDuration-duration);