@Test public void testCopyMemory() throws Exception { byte[] ref = TestUtils.randomBytes(7777 + 130); byte[] arr = new byte[7777 + 130]; long adr = Uns.allocate(7777 + 130); try { for (int offset = 0; offset < 10; offset += 13) for (int off = 0; off < 10; off += 13) { Uns.copyMemory(ref, off, adr, offset, 7777); equals(ref, adr, offset, 7777); Uns.copyMemory(adr, offset, arr, off, 7777); equals(ref, arr, off, 7777); } } finally { Uns.free(adr); } }
static void copyMemory(byte[] arr, int off, long address, long offset, long len) { validate(address, offset, len); unsafe.copyMemory(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, null, address + offset, len); }
Uns { static void copyMemory(byte[] arr, int off, long address, long offset, long len) { validate(address, offset, len); unsafe.copyMemory(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, null, address + offset, len); } }
Uns { static void copyMemory(byte[] arr, int off, long address, long offset, long len) { validate(address, offset, len); unsafe.copyMemory(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, null, address + offset, len); } private  Uns(); }
Uns { static void copyMemory(byte[] arr, int off, long address, long offset, long len) { validate(address, offset, len); unsafe.copyMemory(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, null, address + offset, len); } private  Uns();  }
Uns { static void copyMemory(byte[] arr, int off, long address, long offset, long len) { validate(address, offset, len); unsafe.copyMemory(arr, Unsafe.ARRAY_BYTE_BASE_OFFSET + off, null, address + offset, len); } private  Uns();   }