As opposed to writing to a stream, you may want to read
existing data from it. Before doing this, you can first specify your intent to
the streaming class using the FileMode enumerator. This can be done using
the FileStream class as follows:

Once the stream is ready, you can get prepared to read data
from it. To support this, you can use the BinaryReader class. This class
provides two constructors. One of the constructors (the first) has the following
syntax:

Public Sub New(input As Stream)

This constructor takes as argument a Stream value,
which could be a FileStream object. After declaring a FileStream
variable using this constructor, you can read data from it. To support this, the
class provides an appropriate method for each primitive data type.

After using the stream, you should close it to reclaim the
resources it was using. This is done by calling the Close() method.

Besides the BinaryReader class that reads its values
in binary format, the .NET Framework supports character reading through a class
called StreamReader. The StreamReader class is based on the
TextReader class. Like its counterpart the StramWriter class,
StreamReader is equipped with various constructors. If you want to read
values from a file, you can pass its name or path to the following constructor:

Public Sub New(path As String)

Alternatively, to a FileStream object, you can pass
it to the following constructor of the StreamReader class to create a
stream:

Public Sub New (stream As Stream)

This method takes as argument a Stream-based
variable, which could be a FileStream value. If/since you are planning to
read from a stream, configure your file mode status appropriately. Here is an
example:

After creating a StreamReader object, you can read
data from the file. To support this, the TextReader class is equipped
with the Write() method that the StreamReader class inherits. The
StreamReader class itself is equipped with the ReadLine() method.
Here is an example of calling it:

The first argument is the name of, or the path to, the file
that will receive the new values. The encoding argument allows you to
specify the type of text that you want to use.

This method returns a StreamReader value. After
creating the stream reader, you can then read values from it. To do this, you
can call the ReadLine() method of the StreamReader class. Once
again, after using the stream reader, remember to close it. Here are examples: