IOFile.WriteAsync Method
Overloads
| Name | Description |
|---|---|
WriteAsync(Stream, CancellationToken) | Writes this file to a stream asynchronously. |
WriteAsync(Stream, String, CompressionFormat, CancellationToken) | Writes this file to a stream asynchronously, optionally compressing it. |
WriteAsync(Stream, CancellationToken)
Writes this file to a stream asynchronously.
c#
public Task WriteAsync(Stream stream, CancellationToken cancellationToken = null);Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | The stream to write to. |
cancellationToken | CancellationToken | An CancellationToken to cancel the writing. |
Returns
WriteAsync(Stream, String, CompressionFormat, CancellationToken)
Writes this file to a stream asynchronously, optionally compressing it.
c#
public Task WriteAsync(Stream stream, string filename, CompressionFormat compressionFormat, CancellationToken cancellationToken = null);Parameters
| Name | Type | Description |
|---|---|---|
stream | Stream | The stream to write to. |
filename | String | The filename of the file, with extension. Used as the name of the entry when compressionFormat is Zip. |
compressionFormat | CompressionFormat | The compression format to use. |
cancellationToken | CancellationToken | An optional CancellationToken to cancel the writing. |