mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object System.IDisposable System.Runtime.InteropServices.ComVisible(true)

The class provides methods that simplify reading primitive data types from a stream. For example, you can use the method to read the next byte as a Boolean value and advance the current position in the stream by one byte. The class includes read methods that support different data types.

When you create a new instance of the class, you provide the stream to read from, and optionally specify the type of encoding and whether to leave the stream open after disposing the object. If you do not specify an encoding type, UTF-8 is used.

Reads primitive data types as binary values in a specific encoding.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  For a list of common I/O tasks, see Common I/O Tasks.

  Initializes a new instance of the class based on the specified stream and using UTF-8 encoding.

  The input stream.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  For a list of common I/O tasks, see Common I/O Tasks.

  Initializes a new instance of the class based on the specified stream and character encoding.

  The input stream.
  The character encoding to use.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class based on the specified stream and character encoding, and optionally leaves the stream open.

  The input stream.
  The character encoding to use.
  true to leave the stream open after the object is disposed; otherwise, false.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IO.Stream To be added: an object of type 'Stream'

  Using the underlying stream while reading or while using the BinaryReader can cause data loss and corruption. For example, the same bytes might be read more than once, bytes might be skipped, or character reading might become unpredictable.

  For a list of common I/O tasks, see Common I/O Tasks.

  Exposes access to the underlying stream of the .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  This implementation of Close calls the method passing a true value.

  Flushing the stream will not flush its underlying encoder unless you explicitly call or Close. Setting to true means that data will be flushed from the buffer to the stream, but the encoder state will not be flushed. This allows the encoder to keep its state (partial characters) so that it can encode the next block of characters correctly. This scenario affects UTF8 and UTF7 where certain characters can only be encoded after the encoder receives the adjacent character or characters.

  Closes the current reader and the underlying stream.

- Method
  4.0.0.0
  System.Void

  Call Dispose when you are finished using the . The Dispose method leaves the in an unusable state. After calling Dispose, you must release all references to the so the garbage collector can reclaim the memory that the was occupying.

  For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

  Always call Dispose before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method.

  Releases all resources used by the current instance of the class.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method is called by Dispose and . By default, this method specifies the parameter as true. specifies the parameter as false.

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose method of each referenced object.

  Releases the unmanaged resources used by the class and optionally releases the managed resources.

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The internal buffer size is the larger value between 16 and the value returned by for the specified encoding.

  For a list of common I/O tasks, see Common I/O Tasks.

  Fills the internal buffer with the specified number of bytes read from the stream.

  The number of bytes to be read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  If surrogate characters can be expected in the stream use the method, then set the stream back to the original position.

  For a list of common I/O tasks, see Common I/O Tasks.

  Returns the next available character and does not advance the byte or character position.

  The next available character, or -1 if no more characters are available or the stream does not support seeking.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  does not restore the file position after an unsuccessful read.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.

  The next character from the input stream, or -1 if no characters are currently available.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  does not restore the file position after an unsuccessful read operation.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads the specified number of bytes from the stream, starting from a specified point in the byte array.

  The number of bytes read into . This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the stream is reached.

  The buffer to read data into. The starting point in the buffer at which to begin reading into the buffer. The number of bytes to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  does not restore the file position after an unsuccessful read operation.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads the specified number of characters from the stream, starting from a specified point in the character array.

  The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached.

  The buffer to read data into. The starting point in the buffer at which to begin reading into the buffer. The number of characters to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  does not restore the file position after an unsuccessful read.

  If the integer will fit in seven bits, the integer takes only one byte of space. The integer is expected to have been written through .

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads in a 32-bit integer in compressed format.

  A 32-bit integer in compressed format.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  does not restore the file position after an unsuccessful read.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a Boolean value from the current stream and advances the current position of the stream by one byte.

  true if the byte is nonzero; otherwise, false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte

  does not restore the file position after an unsuccessful read.

  Because of data formatting conflicts, using this method with the following encodings is not recommended:

  UTF-7

  ISO-2022-JP

  ISCII

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads the next byte from the current stream and advances the current position of the stream by one byte.

  The next byte read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] ``

  does not restore the file position after an unsuccessful read operation.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes.

  A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached.

  The number of bytes to read. This value must be 0 or a non-negative number or an exception will occur.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char

  If the method attempts to read a surrogate character in the stream an exception will be raised and the position in the stream will advance. The position is restored to the original location before was called if the stream is seekable; however, if the stream is unseekable, the position will not be corrected. If surrogate characters can be expected in the stream, use the method instead.

  Because of data formatting conflicts, using this method with the following encodings is not recommended:

  UTF-7

  ISO-2022-JP

  ISCII

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads the next character from the current stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream.

  A character read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char[] ``

  does not restore the file position after an unsuccessful read operation.

  When reading from network streams, in some rare cases, the method might read an extra character from the stream if the was constructed with Unicode encoding. If this occurs, you can use the method to read a fixed-length byte array, and then pass that array to the method.

  Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the Encoding used and the specific character being read from the stream.

  A character array containing data read from the underlying stream. This might be less than the number of characters requested if the end of the stream is reached.

  The number of characters to read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal

  does not restore the file position after an unsuccessful read.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes.

  A decimal value read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes.

  An 8-byte floating point value read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes.

  A 2-byte signed integer read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  does not restore the file position after an unsuccessful read.

  reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes.

  A 4-byte signed integer read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads an 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes.

  An 8-byte signed integer read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte

  does not restore the file position after an unsuccessful read.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a signed byte from this stream and advances the current position of the stream by one byte.

  A signed byte read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes.

  A 4-byte floating point value read from the current stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  does not restore the file position after an unsuccessful read.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a string from the current stream. The string is prefixed with the length, encoded as an integer seven bits at a time.

  The string being read.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the position of the stream by two bytes.

  A 2-byte unsigned integer read from this stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes.

  A 4-byte unsigned integer read from this stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64

  does not restore the file position after an unsuccessful read.

  BinaryReader reads this data type in little-endian format.

  For a list of common I/O tasks, see Common I/O Tasks.

  Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes.

  An 8-byte unsigned integer read from this stream.

- Method
  System.Void

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface.

  Releases all resources used by the .

  1.0.5000.0
  2.0.0.0