BinaryWriter Constructor (Stream)

July 28, 2014

Initializes a new instance of the BinaryWriter class based on the supplied stream and using UTF-8 as the encoding for strings.

Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public BinaryWriter(
	Stream output
)

Parameters

output
Type: System.IO.Stream
The output stream.

ExceptionCondition
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.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft