# C1.Util.DX.Storage.ComStream.CopyTo

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_Storage_ComStream_CopyTo_" data-uid="C1.Util.DX.Storage.ComStream.CopyTo*">CopyTo Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_Storage_ComStream_CopyTo_" data-uid="C1.Util.DX.Storage.ComStream.CopyTo*"></a>
<h4 id="C1_Util_DX_Storage_ComStream_CopyTo_C1_Util_DX_Storage_IStream_System_Int64_System_Int64__" data-uid="C1.Util.DX.Storage.ComStream.CopyTo(C1.Util.DX.Storage.IStream,System.Int64,System.Int64@)">CopyTo(IStream, long, out long)</h4>
<div class="markdown level1 summary"><p>Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public long CopyTo(IStream streamDest, long numberOfBytesToCopy, out long bytesWritten)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Function CopyTo(streamDest As IStream, numberOfBytesToCopy As Long, ByRef bytesWritten As Long) As Long</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.Storage.IStream.html">IStream</a></td>
      <td><span class="parametername">streamDest</span></td>
      <td><p>The stream destination.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></td>
      <td><span class="parametername">numberOfBytesToCopy</span></td>
      <td><p>The number of bytes to copy.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></td>
      <td><span class="parametername">bytesWritten</span></td>
      <td><p>The bytes written.</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.int64">long</a></td>
      <td><p>The number of bytes read from this instance</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="C1.Util.DX.Storage.IStream.CopyTo.html#C1_Util_DX_Storage_IStream_CopyTo_C1_Util_DX_Storage_IStream_System_Int64_System_Int64__">IStream.CopyTo(IStream, long, out long)</a></div>
</div>
