# C1.Util.DX.DataPointer.CopyFrom

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DataPointer_CopyFrom_" data-uid="C1.Util.DX.DataPointer.CopyFrom*">CopyFrom Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DataPointer_CopyFrom_" data-uid="C1.Util.DX.DataPointer.CopyFrom*"></a>
<h4 id="C1_Util_DX_DataPointer_CopyFrom__1___0___" data-uid="C1.Util.DX.DataPointer.CopyFrom``1(``0[])">CopyFrom&lt;T&gt;(T[])</h4>
<div class="markdown level1 summary"><p>Writes the content of the specified buffer to the unmanaged memory location of this instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyFrom&lt;T&gt;(T[] buffer) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFrom(Of T As Structure)(buffer As T())</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>T[]</td>
      <td><span class="parametername">buffer</span></td>
      <td><p>The buffer.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>Type of a buffer element</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>buffer</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>DataPointer is Zero</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataPointer_CopyFrom_" data-uid="C1.Util.DX.DataPointer.CopyFrom*"></a>
<h4 id="C1_Util_DX_DataPointer_CopyFrom__1___0___System_Int32_System_Int32_" data-uid="C1.Util.DX.DataPointer.CopyFrom``1(``0[],System.Int32,System.Int32)">CopyFrom&lt;T&gt;(T[], int, int)</h4>
<div class="markdown level1 summary"><p>Writes the content of the specified buffer to the unmanaged memory location of this instance.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void CopyFrom&lt;T&gt;(T[] buffer, int offset, int count) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub CopyFrom(Of T As Structure)(buffer As T(), offset As Integer, count As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>T[]</td>
      <td><span class="parametername">buffer</span></td>
      <td><p>The buffer to read from.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">offset</span></td>
      <td><p>The offset in the array to read from.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">count</span></td>
      <td><p>The number of T element to write to the memory location.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>buffer</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.invalidoperationexception">InvalidOperationException</a></td>
      <td><p>DataPointer is Zero</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>buffer;Total buffer size cannot be larger than size of this data pointer</p>
</td>
    </tr>
  </tbody>
</table>
</div>
