divijvaidya commented on code in PR #12948: URL: https://github.com/apache/kafka/pull/12948#discussion_r1237341025
########## clients/src/main/java/org/apache/kafka/common/utils/ChunkedBytesStream.java: ########## @@ -291,7 +291,7 @@ public long skip(long toSkip) throws IOException { // Skip bytes stored in intermediate buffer first int avail = count - pos; long bytesSkipped = (avail < remaining) ? avail : remaining; - pos += bytesSkipped; + pos += (int) bytesSkipped; Review Comment: @ijuma casting to int here is safe. Can you please add the following comment here: ``` // cast to int is fine here since the value of bytesSkipped is upper bound by value of avail // which is an int ``` It is safe because as per the lines above it `long bytesSkipped = (avail < remaining) ? avail : remaining;`, bytesSkipped is minimum of avail or remaining which means it's max value is available which we know is an int. Same for the other place. -- 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