atiaomar1978-hub opened a new pull request, #25330:
URL: https://github.com/apache/camel/pull/25330

   ## Summary
   
   Fixes [CAMEL-24355](https://issues.apache.org/jira/browse/CAMEL-24355): 
`NIOConverter.toByteArray(ByteBuffer)` threw `BufferUnderflowException` when 
the buffer was already fully read (`position == limit`), which breaks Kinesis 
KCL dead-letter-queue conversion and similar flows.
   
   - Read bytes via `duplicate().rewind()` so conversion uses `[0, limit)` 
regardless of current position
   - Preserve the original buffer position (no side effect on the input 
`ByteBuffer`)
   - Add tests for fully consumed, partially consumed, and empty buffers, plus 
`toString`/`toInputStream` paths that delegate to `toByteArray`
   
   ## Test plan
   
   - [x] `./mvnw -pl core/camel-core -am test -Dtest=NIOConverterTest`
   
   ---
   _AI-generated PR description on behalf of atiaomar1978-hub_
   
   Made with [Cursor](https://cursor.com)


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