Table of Contents

Class CountingQuietTextWriter

Namespace
log4net.Util
Assembly
log4net.dll

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

writer TextWriter

The TextWriter to actually write to.

errorHandler IErrorHandler

The 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

value char

the 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

buffer char[]

the buffer to write

index int

the start index to write from

count int

the 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

value string

The string data to write to the output.

Remarks

Overrides implementation of QuietTextWriter. Counts the number of bytes written.