code: public void setBytes(long memoryOffset, ByteBuffer buffer)
      {
          if (buffer == null)
              throw new NullPointerException();
          else if (buffer.remaining() == 0)
              return;
  
          int bufferOffset = buffer.position();
  
          checkPosition(memoryOffset);
          long end = memoryOffset + buffer.remaining();
          checkPosition(end - 1);
          while (memoryOffset < end)
          {
              unsafe.putByte(peer + memoryOffset, buffer.get(bufferOffset));
              memoryOffset++;
              bufferOffset++;
          }
      }
docs: Transfers count bytes from buffer to Memory
  
  @param memoryOffset start offset in the memory
  @param buffer the data buffer