We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61caea1 commit 83f63d8Copy full SHA for 83f63d8
src/main/java/org/apache/commons/io/input/BoundedInputStream.java
@@ -573,6 +573,15 @@ public synchronized long skip(final long n) throws IOException {
573
return skip;
574
}
575
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
+ */
585
private long toReadLen(final long len) {
586
return maxCount >= 0 ? Math.min(len, maxCount - getCount()) : len;
587
0 commit comments