---
title: "StreamWrapper..::.CopyTo Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_StreamWrapper_CopyTo_4_027d1944.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# StreamWrapper.CopyTo Method 
 
Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Overridable Sub CopyTo ( _pstm As IStream, _cb As Long, _pcbRead As IntPtr, _pcbWritten As IntPtr _
)
```
 
```csharp
public virtual void CopyTo(IStream pstm,long cb,IntPtr pcbRead,IntPtr pcbWritten
)
```
 
### Parameters
 
 - pstm
     - Type: [System.Runtime.InteropServices.ComTypes.IStream](http://msdn2.microsoft.com/en-us/57bd893w)
Reference to the destination stream.

 - cb
     - Type: [System.Int64](http://msdn2.microsoft.com/en-us/6yy583ek)
The number of bytes to copy from the source stream.

 - pcbRead
     - Type: [System.IntPtr](http://msdn2.microsoft.com/en-us/5he14kz8)
On successful return, contains the actual number of bytes read from the source.

 - pcbWritten
     - Type: [System.IntPtr](http://msdn2.microsoft.com/en-us/5he14kz8)
On successful return, contains the actual number of bytes written to the destination.
 
### Implements
 
[IStream.CopyTo(IStream, Int64, IntPtr, IntPtr)](http://msdn2.microsoft.com/en-us/81ts6d01)
 
## Remarks
 For more information, please see the existing documentation for **IStream::CopyTo** in the MSDN library.
   
## See Also

### Reference

- [StreamWrapper Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_StreamWrapper.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
