StreamExtensionsOpenWrite Method |
Opens the given stream for writing with a StreamWriter.
Namespace: Bio.ExtensionsAssembly: Bio.Core (in Bio.Core.dll) Version: 2.0.0.1 (2.0.0.1)
Syntax public static StreamWriter OpenWrite(
this Stream stream,
Encoding encoding = null,
int bufferSize = 1024,
bool leaveOpen = true
)
<ExtensionAttribute>
Public Shared Function OpenWrite (
stream As Stream,
Optional encoding As Encoding = Nothing,
Optional bufferSize As Integer = 1024,
Optional leaveOpen As Boolean = true
) As StreamWriter
public:
[ExtensionAttribute]
static StreamWriter^ OpenWrite(
Stream^ stream,
Encoding^ encoding = nullptr,
int bufferSize = 1024,
bool leaveOpen = true
)
[<ExtensionAttribute>]
static member OpenWrite :
stream : Stream *
?encoding : Encoding *
?bufferSize : int *
?leaveOpen : bool
(* Defaults:
let _encoding = defaultArg encoding null
let _bufferSize = defaultArg bufferSize 1024
let _leaveOpen = defaultArg leaveOpen true
*)
-> StreamWriter
Parameters
- stream
- Type: System.IOStream
Stream - encoding (Optional)
- Type: System.TextEncoding
Encoding, defaults to UTF8 - bufferSize (Optional)
- Type: SystemInt32
Buffer size, defaults to 1k - leaveOpen (Optional)
- Type: SystemBoolean
True to keep underlying stream open on disposal.
Return Value
Type:
StreamWriterStreamWriter
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