sarankumarbaskar opened a new pull request, #860:
URL: https://github.com/apache/commons-io/pull/860

   BoundedReader.skip(long) was updating charsRead using the requested skip 
amount instead of the actual number of characters skipped by the underlying 
reader.
   
   This could make the reader lose track of its bounded position when the 
delegate skipped fewer characters than requested. It also allowed skip requests 
to go past maxCharsFromTargetReader, while read() correctly stops at the 
configured bound.
   
   This PR updates skip(long) to:
   - cap skip requests to the remaining bounded range
   - respect mark/readAheadLimit limits
   - update charsRead using the actual skipped count
   - avoid implicit long-to-int narrowing from charsRead += n
   
   Added regression tests for large skip values, bounded skip behavior, actual 
skipped count, and mark/readAheadLimit behavior.
   
   Fixes: [IO-891](https://issues.apache.org/jira/browse/IO-891)
   
   - [x] Read the [contribution guidelines](CONTRIBUTING.md) for this project.
   - [x] Read the [ASF Generative Tooling 
Guidance](https://www.apache.org/legal/generative-tooling.html).
   - [ ] Run a successful build using the default Maven goal with `mvn`.
   - [x] Wrote unit tests that match the behavioral changes and fail without 
the runtime fix.
   - [x] Wrote a pull request description explaining what changed and why.
   - [x] Each commit has a meaningful subject line and body.


-- 
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]

Reply via email to