BinaryWriter Constructor (Stream)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Initializes a new instance of the BinaryWriter class based on the supplied stream and using UTF-8 as the encoding for strings.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| ArgumentException | The stream does not support writing, or the stream is already closed. |
| ArgumentNullException | output is null. |
The stream is closed when the BinaryWriter object is disposed.
Show: