BinaryReader Constructor (Stream, Encoding, Boolean)
Collapse the table of content
Expand the table of content

BinaryReader Constructor (Stream, Encoding, Boolean)

[ 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 BinaryReader class based on the supplied stream, a specific character encoding, and a value that specifies whether to leave the stream open.

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

'Declaration
Public Sub New ( _
	input As Stream, _
	encoding As Encoding, _
	leaveOpen As Boolean _
)

Parameters

input
Type: System.IO.Stream
The input stream.
encoding
Type: System.Text.Encoding
The character encoding to use.
leaveOpen
Type: System.Boolean
true to leave the stream open; otherwise, false.

ExceptionCondition
ArgumentException

The stream does not support reading, or the stream is already closed.

ArgumentNullException

input or encoding is Nothing.

When leaveOpen is true, the stream is left open after the BinaryReader object is disposed.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft