ppkarwasz commented on code in PR #790:
URL: https://github.com/apache/commons-io/pull/790#discussion_r2393697818
##########
src/main/java/org/apache/commons/io/input/BrokenReader.java:
##########
@@ -114,6 +115,10 @@ public void mark(final int readAheadLimit) throws
IOException {
*/
@Override
public int read(final char[] cbuf, final int off, final int len) throws
IOException {
+ IOUtils.checkFromIndexSize(cbuf, off, len);
Review Comment:
I agree: users should be able to use the class to emulate a “Stream closed”
condition, which is notably checked **before** parameter validation.
In
https://github.com/apache/commons-io/pull/790/commits/48fe1c34398470fb139ed306c48885c91da9f857
I reverted the changes, improved the test suite to include cases with invalid
parameters and added an override of `read(char[])` and `read(CharBuffer)` to
ensure that the right exception is thrown, even if the parameter is `null`.
--
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]