# C1.Util.DX.DataStream.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DataStream__ctor_" data-uid="C1.Util.DX.DataStream.#ctor*">DataStream Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DataStream__ctor_" data-uid="C1.Util.DX.DataStream.#ctor*"></a>
<h4 id="C1_Util_DX_DataStream__ctor_C1_Util_DX_Direct3D11_Blob_" data-uid="C1.Util.DX.DataStream.#ctor(C1.Util.DX.Direct3D11.Blob)">DataStream(Blob)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a> class from a Blob buffer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataStream(Blob buffer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(buffer As Blob)</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="C1.Util.DX.Direct3D11.Blob.html">Blob</a></td>
      <td><span class="parametername">buffer</span></td>
      <td><p>The buffer.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataStream__ctor_" data-uid="C1.Util.DX.DataStream.#ctor*"></a>
<h4 id="C1_Util_DX_DataStream__ctor_System_Int32_System_Boolean_System_Boolean_" data-uid="C1.Util.DX.DataStream.#ctor(System.Int32,System.Boolean,System.Boolean)">DataStream(int, bool, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a> class, and allocates a new buffer to use as a backing store.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataStream(int sizeInBytes, bool canRead, bool canWrite)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(sizeInBytes As Integer, canRead As Boolean, canWrite As Boolean)</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.int32">int</a></td>
      <td><span class="parametername">sizeInBytes</span></td>
      <td><p>The size of the buffer to be allocated, in bytes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">canRead</span></td>
      <td><p><code>true</code> if reading from the buffer should be allowed; otherwise, <code>false</code>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">canWrite</span></td>
      <td><p><code>true</code> if writing to the buffer should be allowed; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataStream__ctor_" data-uid="C1.Util.DX.DataStream.#ctor*"></a>
<h4 id="C1_Util_DX_DataStream__ctor_C1_Util_DX_DataPointer_" data-uid="C1.Util.DX.DataStream.#ctor(C1.Util.DX.DataPointer)">DataStream(DataPointer)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a> class.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataStream(DataPointer dataPointer)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(dataPointer As DataPointer)</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="C1.Util.DX.DataPointer.html">DataPointer</a></td>
      <td><span class="parametername">dataPointer</span></td>
      <td><p>The data pointer.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataStream__ctor_" data-uid="C1.Util.DX.DataStream.#ctor*"></a>
<h4 id="C1_Util_DX_DataStream__ctor_System_IntPtr_System_Int64_System_Boolean_System_Boolean_" data-uid="C1.Util.DX.DataStream.#ctor(System.IntPtr,System.Int64,System.Boolean,System.Boolean)">DataStream(IntPtr, long, bool, bool)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.DataStream.html">DataStream</a> class, using an unmanaged buffer as a backing store.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public DataStream(IntPtr userBuffer, long sizeInBytes, bool canRead, bool canWrite)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(userBuffer As IntPtr, sizeInBytes As Long, canRead As Boolean, canWrite As Boolean)</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">IntPtr</a></td>
      <td><span class="parametername">userBuffer</span></td>
      <td><p>A pointer to the buffer to be used as a backing store.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></td>
      <td><span class="parametername">sizeInBytes</span></td>
      <td><p>The size of the buffer provided, in bytes.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">canRead</span></td>
      <td><p><code>true</code> if reading from the buffer should be allowed; otherwise, <code>false</code>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></td>
      <td><span class="parametername">canWrite</span></td>
      <td><p><code>true</code> if writing to the buffer should be allowed; otherwise, <code>false</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
