apurtell commented on code in PR #4645:
URL: https://github.com/apache/hbase/pull/4645#discussion_r929410292


##########
hbase-common/src/main/java/org/apache/hadoop/hbase/io/TagCompressionContext.java:
##########
@@ -81,7 +81,8 @@ public void compressTags(OutputStream out, byte[] in, int 
offset, int length) th
   public void compressTags(OutputStream out, ByteBuffer in, int offset, int 
length)
     throws IOException {
     if (in.hasArray()) {
-      compressTags(out, in.array(), offset, length);
+      // Offset we are given is relative to ByteBuffer#arrayOffset
+      compressTags(out, in.array(), in.arrayOffset() + offset, length);

Review Comment:
   This is one of several instances where we don't consider `arrayOffset` when 
accessing the contents of a byte[] backing a ByteBuffer. However I don't think 
they are real bugs at this time because we are not `slice()`ing buffers in way 
where offsets would be nonzero, not yet. 



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