title: memcpy function in C++ to Java equivalent
body: <p>I have in C++</p>
  
  <pre><code>memcpy (&amp;wkpm, (PMSK *)pr_masks + (long)(x - 1), sizeof(PMSK)); 
  </code></pre>
  
  <p>where <code>PMSK</code> is a struct. It will be a class in Java.</p>
  
  <p>Now assuming that here I am copying the whole chunk of memory into pr_masks i.e creating an additional instance of the <code>PMSK</code> class.
  How to do this in Java.</p>
  
  <p>Example: In a java code at line 20 I want capture the class instance and then again use that same instance in line 100. In between there may be many modifications. </p>
  
  <p>Hope I am clear with my question.</p>
  
  <p>Thanks  </p>