Show / Hide Table of Contents

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
IWritesStreamToTextWriter
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 Source

StreamToTextWriterCopier()

Initializes a new instance of the StreamToTextWriterCopier class.

Declaration
public StreamToTextWriterCopier()
| Improve this Doc View Source

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 Source

WriteToTextWriterAsync(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.

Implements

IWritesStreamToTextWriter
  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • StreamToTextWriterCopier()
    • StreamToTextWriterCopier(Int32)
  • Methods
    • WriteToTextWriterAsync(Stream, TextWriter, CancellationToken)
  • Implements
Back to top Generated by DocFX