AndrewJSchofield commented on code in PR #19581: URL: https://github.com/apache/kafka/pull/19581#discussion_r2069906803
########## clients/src/main/java/org/apache/kafka/common/record/Records.java: ########## @@ -90,4 +91,18 @@ public interface Records extends TransferableRecords { * @return The record iterator */ Iterable<Record> records(); + + /** + * Return a slice of records from this instance, which is a view into this set starting from the given position + * and with the given size limit. + * + * If the size is beyond the end of the records, the end will be based on the size of the records at the time of the read. + * + * If this records set is already sliced, the position will be taken relative to that slicing. + * + * @param position The start position to begin the read from + * @param size The number of bytes after the start position to include + * @return A sliced wrapper on this message set limited based on the given position and size + */ + Records slice(int position, int size) throws IOException; Review Comment: Yes, we could, but there would be downstream effects of that. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org