ppkarwasz commented on code in PR #790:
URL: https://github.com/apache/commons-io/pull/790#discussion_r2394060533


##########
src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java:
##########
@@ -125,12 +125,9 @@ public int read() throws IOException {
 
     @Override
     public int read(final byte[] targetBuffer, final int offset, final int 
length) throws IOException {
-        Objects.requireNonNull(targetBuffer, "targetBuffer");
-        if (offset < 0) {
-            throw new IllegalArgumentException("Offset must not be negative");
-        }
-        if (length < 0) {
-            throw new IllegalArgumentException("Length must not be negative");
+        IOUtils.checkFromIndexSize(targetBuffer, offset, length);

Review Comment:
   The new error message contains all three values (`off`, len` and 
`b.length`), so it is equivalent.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to