Skip to content

Commit 7c6c673

Browse files
committed
fix off-by-one mistake with integer arithmetic so RecordingInputStreamTest.testReadFullyOrUntil() test passes (how did this ever pass?)
1 parent acec0d4 commit 7c6c673

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/archive/io/RecordingOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ protected void checkLimits() throws RecorderIOException {
296296
throw new RecorderTimeoutException();
297297
}
298298
// need to throttle reading to hit max configured rate?
299-
if(position/duration > maxRateBytesPerMs) {
299+
if(position/duration >= maxRateBytesPerMs) {
300300
long desiredDuration = position / maxRateBytesPerMs;
301301
try {
302302
Thread.sleep(desiredDuration-duration);

0 commit comments

Comments
 (0)