squah-confluent commented on PR #22963:
URL: https://github.com/apache/kafka/pull/22963#issuecomment-5205306570

   Thanks for the patch!
   
   > The alternative would be to make FileRecords#readInto stop at the
   slice boundary. That is a wider change: it contradicts the method's
   documented contract ("until there are no bytes remaining in the buffer
   or the end of the file is reached") and affects its other callers, so
   this patch bounds the buffer at the call sites that need it instead.
   
   The current API design is questionable and sets callers up for failure. It's 
not reasonable to anticipate `FileRecords.readInto()` reading more than 
`FileRecords.sizeInBytes()` bytes. I think we should revisit the API contract.


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