< prev index next >

src/java.base/share/classes/java/nio/Bits.java

Print this page

        

@@ -773,11 +773,11 @@
         long offset = srcBaseOffset + srcPos;
         while (length > 0) {
             long size = (length > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : length;
             unsafe.copyMemory(src, offset, null, dstAddr, size);
             length -= size;
-            offset += size;
+            offset += (size << 1);
             dstAddr += size;
         }
     }
 
     /**

@@ -801,11 +801,11 @@
         while (length > 0) {
             long size = (length > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : length;
             unsafe.copyMemory(null, srcAddr, dst, offset, size);
             length -= size;
             srcAddr += size;
-            offset += size;
+            offset += (size << 1);
         }
     }
 
     static void copyFromCharArray(Object src, long srcPos, long dstAddr,
                                   long length)
< prev index next >