StreamExtensionsOpenRead Method |
Opens the given stream for reading with a StreamReader.
Namespace: Bio.ExtensionsAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static StreamReader OpenRead(
this Stream stream,
Encoding encoding = null,
bool detectEncodingFromByteOrderMarks = true,
int bufferSize = 1024,
bool leaveOpen = true
)
<ExtensionAttribute>
Public Shared Function OpenRead (
stream As Stream,
Optional encoding As Encoding = Nothing,
Optional detectEncodingFromByteOrderMarks As Boolean = true,
Optional bufferSize As Integer = 1024,
Optional leaveOpen As Boolean = true
) As StreamReader
public:
[ExtensionAttribute]
static StreamReader^ OpenRead(
Stream^ stream,
Encoding^ encoding = nullptr,
bool detectEncodingFromByteOrderMarks = true,
int bufferSize = 1024,
bool leaveOpen = true
)
[<ExtensionAttribute>]
static member OpenRead :
stream : Stream *
?encoding : Encoding *
?detectEncodingFromByteOrderMarks : bool *
?bufferSize : int *
?leaveOpen : bool
(* Defaults:
let _encoding = defaultArg encoding null
let _detectEncodingFromByteOrderMarks = defaultArg detectEncodingFromByteOrderMarks true
let _bufferSize = defaultArg bufferSize 1024
let _leaveOpen = defaultArg leaveOpen true
*)
-> StreamReader
Parameters
- stream
- Type: System.IOStream
Stream - encoding (Optional)
- Type: System.TextEncoding
Encoding, defaults to UTF8 - detectEncodingFromByteOrderMarks (Optional)
- Type: SystemBoolean
[Missing <param name="detectEncodingFromByteOrderMarks"/> documentation for "M:Bio.Extensions.StreamExtensions.OpenRead(System.IO.Stream,System.Text.Encoding,System.Boolean,System.Int32,System.Boolean)"]
- bufferSize (Optional)
- Type: SystemInt32
Buffer size, defaults to 1k - leaveOpen (Optional)
- Type: SystemBoolean
True to keep underlying stream open on disposal.
Return Value
Type:
StreamReaderStreamReader
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
Stream. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also