Name

StreamReader

Synopsis

This class is an extension of a TextReader and provides implementations for all its methods. CurrentEncoding returns the current encoding the StreamReader is using. If you would like to discard the buffered data (so it isn’t written to a disk or other resource), call DiscardBufferedData().

This class is a quick way to open a file for reading. Simply call the constructor with a string containing the filename, and you can immediately begin reading from the file with methods such as Read(), ReadLine(), or ReadToEnd().

Public Class StreamReader : Inherits TextReader
' Public Constructors
   Public Sub New( ByVal stream As Stream) 
   Public Sub New(ByVal stream As Stream, 
        ByVal detectEncodingFromByteOrderMarks As Boolean) 
   Public Sub New(ByVal stream As Stream, 
        ByVal encoding As System.Text.Encoding) 
   Public Sub New(ByVal stream As Stream, 
        ByVal encoding As System.Text.Encoding, 
        ByVal detectEncodingFromByteOrderMarks As Boolean) 
   Public Sub New(ByVal stream As Stream, 
        ByVal encoding As System.Text.Encoding, 
        ByVal detectEncodingFromByteOrderMarks As Boolean, 
        ByVal bufferSize As Integer) 
   Public Sub New( ByVal path As String) 
   Public Sub New(ByVal path As String, 
        ByVal detectEncodingFromByteOrderMarks As Boolean) 
   Public Sub New(ByVal path As String, 
        ByVal encoding As System.Text.Encoding) 
   Public Sub New(ByVal path As String, 
        ByVal encoding As System.Text.Encoding, 
        ByVal detectEncodingFromByteOrderMarks As Boolean) 
   Public Sub New(ByVal path As String, ByVal encoding As System.Text.Encoding, ...

Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.