ppkarwasz commented on code in PR #790:
URL: https://github.com/apache/commons-io/pull/790#discussion_r2394055177
##########
src/main/java/org/apache/commons/io/input/NullInputStream.java:
##########
@@ -292,7 +294,8 @@ public int read(final byte[] bytes) throws IOException {
*/
@Override
public int read(final byte[] bytes, final int offset, final int length)
throws IOException {
- if (bytes.length == 0 || length == 0) {
+ IOUtils.checkFromIndexSize(bytes, offset, length);
+ if (length == 0) {
Review Comment:
If `bytes.length` is zero, then either `length` is zero too or
`IndexOutOfBoundsException` is thrown for any other value of `length`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]