System.IO.TextReader.Synchronized Method

Creates a thread-safe wrapper around the specified TextReader.

Syntax

public static TextReader Synchronized (TextReader reader)

Parameters

reader
The TextReader to synchronize.

Returns

A thread-safe System.IO.TextReader.

Exceptions

TypeReason
ArgumentNullExceptionThe reader parameter is null.

Remarks

The current method returns a class that wraps around the specified System.IO.TextReader instance and restricts access to it by multiple threads. All reads from the returned wrapper will be thread safe.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0