Class CountingQuietTextWriter
Subclass of QuietTextWriter that maintains a count of the number of bytes written.
public class CountingQuietTextWriter : QuietTextWriter, IDisposable
- Inheritance
-
CountingQuietTextWriter
- Implements
- Inherited Members
Remarks
This writer counts the number of bytes written.
Constructors
CountingQuietTextWriter(TextWriter, IErrorHandler)
Constructor
public CountingQuietTextWriter(TextWriter writer, IErrorHandler errorHandler)
Parameters
writerTextWriterThe TextWriter to actually write to.
errorHandlerIErrorHandlerThe IErrorHandler to report errors to.
Remarks
Creates a new instance of the CountingQuietTextWriter class with the specified TextWriter and IErrorHandler.
Properties
Count
Gets or sets the total number of bytes written.
public long Count { get; set; }
Property Value
- long
The total number of bytes written.
Remarks
Gets or sets the total number of bytes written.
Methods
Write(char)
Writes a character to the underlying writer and counts the number of bytes written.
public override void Write(char value)
Parameters
valuecharthe char to write
Remarks
Overrides implementation of QuietTextWriter. Counts the number of bytes written.
Write(char[], int, int)
Writes a buffer to the underlying writer and counts the number of bytes written.
public override void Write(char[] buffer, int index, int count)
Parameters
bufferchar[]the buffer to write
indexintthe start index to write from
countintthe number of characters to write
Remarks
Overrides implementation of QuietTextWriter. Counts the number of bytes written.
Write(string?)
Writes a string to the output and counts the number of bytes written.
public override void Write(string? value)
Parameters
valuestringThe string data to write to the output.
Remarks
Overrides implementation of QuietTextWriter. Counts the number of bytes written.