RazorTextWriter Class

Summary

A [System.IO.TextWriter]() that is backed by a unbuffered writer (over the Response stream) and a buffered [Microsoft.AspNet.Mvc.Rendering.StringCollectionTextWriter](). When <c>Flush</c> or <c>FlushAsync</c> is invoked, the writer copies all content from the buffered writer to the unbuffered one and switches to writing to the unbuffered writer for all further write operations.

Inheritance Hierarchy

Syntax

public class RazorTextWriter : TextWriter, IDisposable, IBufferedTextWriter

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.Razor.RazorTextWriter

Constructors

RazorTextWriter(System.IO.TextWriter, System.Text.Encoding)

Creates a new instance of [Microsoft.AspNet.Mvc.Razor.RazorTextWriter](Microsoft.AspNet.Mvc.Razor.RazorTextWriter.yml).

Arguments:
  • unbufferedWriter (System.IO.TextWriter) – The [System.IO.TextWriter]() to write output to when this instance is no longer buffering.
  • encoding (System.Text.Encoding) – The character [Microsoft.AspNet.Mvc.Razor.RazorTextWriter.Encoding](Microsoft.AspNet.Mvc.Razor.RazorTextWriter.yml) in which the output is written.
public RazorTextWriter(TextWriter unbufferedWriter, Encoding encoding)

Properties

Encoding()
Return type:System.Text.Encoding
public override Encoding Encoding { get; }
IsBuffering()
Return type:System.Boolean
public bool IsBuffering { get; }

Methods

CopyTo(System.IO.TextWriter)
Arguments:
  • writer (System.IO.TextWriter) –
public void CopyTo(TextWriter writer)
CopyToAsync(System.IO.TextWriter)
Arguments:
  • writer (System.IO.TextWriter) –
Return type:

System.Threading.Tasks.Task

public Task CopyToAsync(TextWriter writer)
Microsoft.AspNet.Mvc.Razor.RazorTextWriter.Flush()

Copies the buffered content to the unbuffered writer and invokes flush on it. Additionally causes this instance to no longer buffer and direct all write operations to the unbuffered writer.

public override void Flush()
Microsoft.AspNet.Mvc.Razor.RazorTextWriter.FlushAsync()

Copies the buffered content to the unbuffered writer and invokes flush on it. Additionally causes this instance to no longer buffer and direct all write operations to the unbuffered writer.

Return type:System.Threading.Tasks.Task
Returns:A [System.Threading.Tasks.Task]() that represents the asynchronous copy and flush operations.
public override Task FlushAsync()
Write(System.Char)
Arguments:
  • value (System.Char) –
public override void Write(char value)
Write(System.Char[], System.Int32, System.Int32)
Arguments:
  • buffer (System.Char[]) –
  • index (System.Int32) –
  • count (System.Int32) –
public override void Write(char[] buffer, int index, int count)
Write(System.Object)
Arguments:
  • value (System.Object) –
public override void Write(object value)
Write(System.String)
Arguments:
  • value (System.String) –
public override void Write(string value)
WriteAsync(System.Char)
Arguments:
  • value (System.Char) –
Return type:

System.Threading.Tasks.Task

public override Task WriteAsync(char value)
WriteAsync(System.Char[], System.Int32, System.Int32)
Arguments:
  • buffer (System.Char[]) –
  • index (System.Int32) –
  • count (System.Int32) –
Return type:

System.Threading.Tasks.Task

public override Task WriteAsync(char[] buffer, int index, int count)
WriteAsync(System.String)
Arguments:
  • value (System.String) –
Return type:

System.Threading.Tasks.Task

public override Task WriteAsync(string value)
Microsoft.AspNet.Mvc.Razor.RazorTextWriter.WriteLine()
public override void WriteLine()
WriteLine(System.String)
Arguments:
  • value (System.String) –
public override void WriteLine(string value)
Microsoft.AspNet.Mvc.Razor.RazorTextWriter.WriteLineAsync()
Return type:System.Threading.Tasks.Task
public override Task WriteLineAsync()
WriteLineAsync(System.Char)
Arguments:
  • value (System.Char) –
Return type:

System.Threading.Tasks.Task

public override Task WriteLineAsync(char value)
WriteLineAsync(System.Char[], System.Int32, System.Int32)
Arguments:
  • value (System.Char[]) –
  • start (System.Int32) –
  • offset (System.Int32) –
Return type:

System.Threading.Tasks.Task

public override Task WriteLineAsync(char[] value, int start, int offset)
WriteLineAsync(System.String)
Arguments:
  • value (System.String) –
Return type:

System.Threading.Tasks.Task

public override Task WriteLineAsync(string value)