public void setBytes(long memoryOffset, byte[] buffer, int bufferOffset, int count)
    {
        if (buffer == null)
            throw new NullPointerException();
        else if (bufferOffset < 0
                 || count < 0
                 || bufferOffset + count > buffer.length)
            throw new IndexOutOfBoundsException();
        else if (count == 0)
            return;

        long end = memoryOffset + count;
        checkBounds(memoryOffset, end);

        unsafe.copyMemory(buffer, BYTE_ARRAY_BASE_OFFSET + bufferOffset, null, peer + memoryOffset, count);
    }
public void setBytes ( long memoryOffset , byte [ ] buffer , int bufferOffset , int count ) { if ( buffer == null ) throw new NullPointerException ( ) ; else if ( bufferOffset < 0 || count < 0 || bufferOffset + count > buffer . length ) throw new IndexOutOfBoundsException ( ) ; else if ( count == 0 ) return ; long end = memoryOffset + count ; checkBounds ( memoryOffset , end ) ; unsafe . copyMemory ( buffer , BYTE_ARRAY_BASE_OFFSET + bufferOffset , null , peer + memoryOffset , count ) ; }
Transfers count bytes from buffer to Memory

@param memoryOffset start offset in the memory
@param buffer the data buffer
@param bufferOffset start offset of the buffer
@param count number of bytes to transfer