public static void setBytes(byte[] src, int offset, long trg, long count) {
        while (count > 0) {
            long size = (count > UNSAFE_COPY_THRESHOLD) ? UNSAFE_COPY_THRESHOLD : count;
            unsafe.copyMemory(src, BYTE_ARRAY_BASE_OFFSET + offset, null, trg, size);
            count -= size;
            offset += size;
            trg += size;
        }
    }
Transfers objCount bytes from buffer to Memory

@param address      start offset in the memory
@param buffer       the data buffer
@param bufferOffset start offset of the buffer
@param count        number of bytes to transfer
indexr-common/src/main/java/io/indexr/util/MemoryUtil.java