Skip to content

Commit 83f63d8

Browse files
committed
Javadoc
1 parent 61caea1 commit 83f63d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/apache/commons/io/input/BoundedInputStream.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,15 @@ public synchronized long skip(final long n) throws IOException {
573573
return skip;
574574
}
575575

576+
/**
577+
* Converts a request to read {@code len} bytes to a lower count if reading would put us over the limit.
578+
* <p>
579+
* If a {@code maxCount} is not set, then return max{@code maxCount}.
580+
* </p>
581+
*
582+
* @param len The requested byte count.
583+
* @return How many bytes to actually attempt to read.
584+
*/
576585
private long toReadLen(final long len) {
577586
return maxCount >= 0 ? Math.min(len, maxCount - getCount()) : len;
578587
}

0 commit comments

Comments
 (0)