# C1.Util.DX.DXUtil.Read

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DXUtil_Read_" data-uid="C1.Util.DX.DXUtil.Read*">Read Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DXUtil_Read_" data-uid="C1.Util.DX.DXUtil.Read*"></a>
<h4 id="C1_Util_DX_DXUtil_Read__1_System_IntPtr_" data-uid="C1.Util.DX.DXUtil.Read``1(System.IntPtr)">Read&lt;T&gt;(nint)</h4>
<div class="markdown level1 summary"><p>Reads the specified T data from a memory location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static T Read&lt;T&gt;(nint source) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Read(Of T As Structure)(source As IntPtr) 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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>Memory location to read from.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="xref">T</span></td>
      <td><p>The data read from 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><p>Type of a data to read.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DXUtil_Read_" data-uid="C1.Util.DX.DXUtil.Read*"></a>
<h4 id="C1_Util_DX_DXUtil_Read__1_System_IntPtr___0__" data-uid="C1.Util.DX.DXUtil.Read``1(System.IntPtr,``0@)">Read&lt;T&gt;(nint, ref T)</h4>
<div class="markdown level1 summary"><p>Reads the specified T data from a memory location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static void Read&lt;T&gt;(nint source, ref T data) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Sub Read(Of T As Structure)(source As IntPtr, ByRef data 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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>Memory location to read from.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">T</span></td>
      <td><span class="parametername">data</span></td>
      <td><p>The data write to.</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 data to read.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DXUtil_Read_" data-uid="C1.Util.DX.DXUtil.Read*"></a>
<h4 id="C1_Util_DX_DXUtil_Read__1_System_IntPtr___0___System_Int32_System_Int32_" data-uid="C1.Util.DX.DXUtil.Read``1(System.IntPtr,``0[],System.Int32,System.Int32)">Read&lt;T&gt;(nint, T[], int, int)</h4>
<div class="markdown level1 summary"><p>Reads the specified array T[] data from a memory location.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static nint Read&lt;T&gt;(nint source, T[] data, int offset, int count) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function Read(Of T As Structure)(source As IntPtr, data As T(), offset As Integer, count As Integer) As IntPtr</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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>Memory location to read from.</p>
</td>
    </tr>
    <tr>
      <td>T[]</td>
      <td><span class="parametername">data</span></td>
      <td><p>The data write to.</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 write to.</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 read from the memory location.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">nint</a></td>
      <td><p>source pointer + sizeof(T) * count.</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 data to read.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
