apurtell commented on a change in pull request #3691:
URL: https://github.com/apache/hbase/pull/3691#discussion_r715792772
##########
File path:
hbase-common/src/main/java/org/apache/hadoop/hbase/util/UnsafeAccess.java
##########
@@ -330,6 +330,20 @@ public static void copy(byte[] src, int srcOffset,
ByteBuffer dest, int destOffs
unsafeCopy(src, srcAddress, destBase, destAddress, length);
}
+ /**
+ * Copies the bytes from given array's offset to length part into the given
array.
+ * @param src source array
+ * @param srcOffset offset into source buffer
+ * @param dest destination array
+ * @param destOffset offset into destination buffer
+ * @param length length of data to copy
+ */
+ public static void copy(byte[] src, int srcOffset, byte[] dest, int
destOffset, int length) {
Review comment:
The unsafe version is faster than arraycopy because it does not do
bounds checking, right? I don't have a strong opinion about this, though.
--
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]