This documentation is archived and is not being maintained.

TextReader.Null Field

Provides a TextReader with no data to read from.

[Visual Basic]
Public Shared ReadOnly Null As TextReader
[C#]
public static readonly TextReader Null;
[C++]
public: static TextReader* Null;
[JScript]
public static var Null : TextReader;

Remarks

Reading from the Null text reader is similar to reading from the end of a stream:

Read and Peek methods return -1.

ReadBlock method returns zero.

ReadLine and ReadToEnd methods return a null reference (Nothing in Visual Basic).

The following table lists examples of other typical or related I/O tasks.

To do this... See the example in this topic...
Create a text file. Writing Text to a File
Write to a text file. Writing Text to a File
Read from a text file. Reading Text from a File

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

TextReader Class | TextReader Members | System.IO Namespace | Working with I/O | Reading Text from a File | Writing Text to a File

Show: