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 13:08:35 UTC

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

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


##########
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:
   Nice catch. Can we extend the tests to cover both of the cases discussed here too?



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