You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/12/21 15:54:26 UTC

[GitHub] [kafka] michaeljmarshall commented on a diff in pull request #13032: KAFKA-14540: Fix DataOutputStreamWritable#writeByteBuffer

michaeljmarshall commented on code in PR #13032:
URL: https://github.com/apache/kafka/pull/13032#discussion_r1054547725


##########
clients/src/main/java/org/apache/kafka/common/protocol/DataOutputStreamWritable.java:
##########
@@ -99,7 +99,7 @@ public void writeUnsignedVarint(int i) {
     public void writeByteBuffer(ByteBuffer buf) {
         try {
             if (buf.hasArray()) {
-                out.write(buf.array(), buf.position(), buf.limit());
+                out.write(buf.array(), buf.arrayOffset(), buf.limit());

Review Comment:
   Great catch, thank you for your reviews. I'll fix the implementation and make sure the missed cases are covered by tests.



-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org