Class StreamToTextWriterCopier
Implementation of IWritesStreamToTextWriter which uses either a stream-copy (if the text writer is in fact a System.IO.StreamWriter), or otherwise a buffered read & write if the text writer is any other implementation.
Inheritance
System.Object
StreamToTextWriterCopier
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ZptSharp
Assembly: ZptSharp.dll
Syntax
public class StreamToTextWriterCopier : IWritesStreamToTextWriter
Constructors
| Improve this Doc View SourceStreamToTextWriterCopier()
Initializes a new instance of the StreamToTextWriterCopier class.
Declaration
public StreamToTextWriterCopier()
StreamToTextWriterCopier(Int32)
Initializes a new instance of the StreamToTextWriterCopier class.
Declaration
public StreamToTextWriterCopier(int bufferSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | bufferSize | Buffer size. |
Methods
| Improve this Doc View SourceWriteToTextWriterAsync(Stream, TextWriter, CancellationToken)
Writes the contents of the stream
to the specified
writer
.
Declaration
public Task WriteToTextWriterAsync(Stream stream, TextWriter writer, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream to write. |
System.IO.TextWriter | writer | The text writer. |
System.Threading.CancellationToken | token | An optional cancellation token |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task which indicates when the work is finished. |