Constructors: NewStreamReader |
Creates a new StreamReader from either a FileName or an existing stream to read from.
Public Function NewStreamReader( ByRef Source As Variant, Optional ByVal Encoding As Encoding, Optional ByVal DetermineEncodingFromByteOrderMarks As Boolean = True, Optional ByVal BufferSize As Long = 1024, Optional ByVal LeaveOpen As Boolean ) As StreamReader
Default: True
Default: 1024
If a file name is specified, then an internal FileStream object is created using an initialization of Cor.NewFileStream(Source, FileMode.OpenExisting, FileAccess.ReadAccess, FileShare.ReadShare).
If DetermineEncodingFromByteOrderMarks is True, then up to 3 bytes are read from the stream upon the first attempt to read any data from the stream. The bytes are used to determine if a specific encoding has been used. There are 3 encoding signatures that are looked for.
BOM | Encoding |
---|---|
&HFE, &HFF | UnicodeEncoding with little-endian byte ordering is used. |
&HFF, &HFE | UnicodeEncoding with big-endian byte ordering is used. |
&HEF, &HBB, &HBF | UTF8Encoding is used. |