jsancio commented on code in PR #23737:
URL: https://github.com/apache/kafka/pull/23737#discussion_r4199244273


##########
clients/src/main/java/org/apache/kafka/common/record/internal/FileRecords.java:
##########
@@ -141,6 +140,25 @@ public void readInto(ByteBuffer buffer, int position) 
throws IOException {
         buffer.flip();
     }
 
+    /**
+     * Read log batches into the given buffer until there are no bytes 
remaining in the buffer or the end of
+     * this FileRecords object is reached.
+     *
+     * @param buffer The buffer to write the batches to
+     * @param position Position to start reading from, relative to the start 
of this FileRecords object
+     * @throws IOException If an I/O error occurs, see {@link 
FileChannel#read(ByteBuffer, long)} for details on the
+     * possible exceptions
+     * @throws IllegalArgumentException If the position is negative or greater 
than the size of this FileRecords object
+     */
+    public void readUntil(ByteBuffer buffer, int position) throws IOException {

Review Comment:
   Take a look at 
[writeTo](https://github.com/apache/kafka/pull/23737/changes#diff-eb2526e152297a40444881831690859113bccec97cc9de752dd9634a755ceecaR311-R323).
   
   I would expect the read semantic of `readInto` to be similar to `writeTo`.



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