# C1.Util.DX.DataStream.Write

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*">Write Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write__1___0_" data-uid="C1.Util.DX.DataStream.Write``1(``0)">Write&lt;T&gt;(T)</h4>
<div class="markdown level1 summary"><p>Writes a single value to the stream, and advances the current position
within this stream by the number of bytes written.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write&lt;T&gt;(T value) where T : struct</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(Of T As Structure)(value 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><span class="xref">T</span></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value to write to the stream.</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>The type of the value to be written to the stream.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write__1___0__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>
<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.notsupportedexception">NotSupportedException</a></td>
      <td><p>The stream does not support writing.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_Single_" data-uid="C1.Util.DX.DataStream.Write(System.Single)">Write(float)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(float value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Single)</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.single">float</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_System_Single__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_Int32_" data-uid="C1.Util.DX.DataStream.Write(System.Int32)">Write(int)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(int value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value 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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_Int16_" data-uid="C1.Util.DX.DataStream.Write(System.Int16)">Write(short)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(short value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Short)</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.int16">short</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_System_Int16__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_Boolean_" data-uid="C1.Util.DX.DataStream.Write(System.Boolean)">Write(bool)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(bool value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value 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.boolean">bool</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_System_Boolean__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector2_" data-uid="C1.Util.DX.DataStream.Write(C1.Util.DX.Vector2)">Write(Vector2)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(Vector2 value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Vector2)</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.Vector2.html">Vector2</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector2__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector3_" data-uid="C1.Util.DX.DataStream.Write(C1.Util.DX.Vector3)">Write(Vector3)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(Vector3 value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Vector3)</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.Vector3.html">Vector3</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector3__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector4_" data-uid="C1.Util.DX.DataStream.Write(C1.Util.DX.Vector4)">Write(Vector4)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(Vector4 value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Vector4)</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.Vector4.html">Vector4</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Vector4__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_C1_Util_DX_ColorF_" data-uid="C1.Util.DX.DataStream.Write(C1.Util.DX.ColorF)">Write(ColorF)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(ColorF value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As ColorF)</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.ColorF.html">ColorF</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_C1_Util_DX_ColorF__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Matrix4x4_" data-uid="C1.Util.DX.DataStream.Write(C1.Util.DX.Matrix4x4)">Write(Matrix4x4)</h4>
<div class="markdown level1 summary"><p>Writes the specified value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(Matrix4x4 value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(value As Matrix4x4)</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.Matrix4x4.html">Matrix4x4</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_Util_DX_DataStream_Write_C1_Util_DX_Matrix4x4__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_Byte___System_Int32_System_Int32_" data-uid="C1.Util.DX.DataStream.Write(System.Byte[],System.Int32,System.Int32)">Write(byte[], int, int)</h4>
<div class="markdown level1 summary"><p>Writes a sequence of bytes to the current stream and advances the current
position within this stream by the number of bytes written.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public override void Write(byte[] buffer, int offset, int count)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Overrides Sub Write(buffer As Byte(), 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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</td>
      <td><span class="parametername">buffer</span></td>
      <td><p>An array of bytes. This method copies count bytes from buffer to the current stream.</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 zero-based byte offset in buffer at which to begin copying bytes to the current stream.</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 bytes to be written to the current stream.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="overrides">Overrides</h5>
<div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.write">Stream.Write(byte[], int, int)</a></div>
<h5 id="C1_Util_DX_DataStream_Write_System_Byte___System_Int32_System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>In order to provide faster read/write, this operation doesn't check stream bound.
A client must carefully not read/write above the size of this datastream.</p>
</div>
<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.notsupportedexception">NotSupportedException</a></td>
      <td><p>This stream does not support writing.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_DataStream_Write_" data-uid="C1.Util.DX.DataStream.Write*"></a>
<h4 id="C1_Util_DX_DataStream_Write_System_IntPtr_System_Int32_System_Int32_" data-uid="C1.Util.DX.DataStream.Write(System.IntPtr,System.Int32,System.Int32)">Write(IntPtr, int, int)</h4>
<div class="markdown level1 summary"><p>When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Write(IntPtr buffer, int offset, int count)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Write(buffer As IntPtr, 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><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.intptr">IntPtr</a></td>
      <td><span class="parametername">buffer</span></td>
      <td><p>An array of bytes. This method copies <code class="paramref">count</code> bytes from <code class="paramref">buffer</code> to the current stream.</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 zero-based byte offset in <code class="paramref">buffer</code> at which to begin copying bytes to the current stream.</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 bytes to be written to the current stream.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
