System.IO
Reads primitive data types as binary values in a specific encoding.
2
Initializes a new instance of the class based on the specified stream and using UTF-8 encoding.
The input stream.
The stream does not support reading, is null, or is already closed.
Initializes a new instance of the class based on the specified stream and character encoding.
The input stream.
The character encoding to use.
The stream does not support reading, is null, or is already closed.
is null.
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.
The stream does not support reading, is null, or is already closed.
or is null.
Exposes access to the underlying stream of the .
The underlying stream associated with the BinaryReader.
2
Releases all resources used by the current instance of the class.
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.
Fills the internal buffer with the specified number of bytes read from the stream.
The number of bytes to be read.
The end of the stream is reached before could be read.
An I/O error occurs.
Requested is larger than the internal buffer size.
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.
An I/O error occurs.
The current character cannot be decoded into the internal character buffer by using the selected for the stream.
2
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.
An I/O error occurs.
The stream is closed.
2
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.
The buffer length minus is less than . -or-The number of decoded characters to read is greater than . This can happen if a Unicode decoder returns fallback characters or a surrogate pair.
is null.
or is negative.
The stream is closed.
An I/O error occurs.
2
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.
The buffer length minus is less than . -or-The number of decoded characters to read is greater than . This can happen if a Unicode decoder returns fallback characters or a surrogate pair.
is null.
or is negative.
The stream is closed.
An I/O error occurs.
2
Reads in a 32-bit integer in compressed format.
A 32-bit integer in compressed format.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
The stream is corrupted.
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The number of decoded characters to read is greater than . This can happen if a Unicode decoder returns fallback characters or a surrogate pair.
An I/O error occurs.
The stream is closed.
is negative.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
A surrogate character was read.
2
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.
The number of decoded characters to read is greater than . This can happen if a Unicode decoder returns fallback characters or a surrogate pair.
The stream is closed.
An I/O error occurs.
is negative.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
The stream is closed.
An I/O error occurs.
2
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.
The end of the stream is reached.
An I/O error occurs.
The stream is closed.
2
Writes primitive types in binary to a stream and supports writing strings in a specific encoding.
2
Initializes a new instance of the class that writes to a stream.
Initializes a new instance of the class based on the specified stream and using UTF-8 encoding.
The output stream.
The stream does not support writing or is already closed.
is null.
Initializes a new instance of the class based on the specified stream and character encoding.
The output stream.
The character encoding to use.
The stream does not support writing or is already closed.
or is null.
Initializes a new instance of the class based on the specified stream and character encoding, and optionally leaves the stream open.
The output stream.
The character encoding to use.
true to leave the stream open after the object is disposed; otherwise, false.
The stream does not support writing or is already closed.
or is null.
Gets the underlying stream of the .
The underlying stream associated with the BinaryWriter.
1
Releases all resources used by the current instance of the class.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
1
Specifies a with no backing store.
1
Holds the underlying stream.
Sets the position within the current stream.
The position with the current stream.
A byte offset relative to .
A field of indicating the reference point from which the new position is to be obtained.
The file pointer was moved to an invalid location.
The value is invalid.
1
Writes a one-byte Boolean value to the current stream, with 0 representing false and 1 representing true.
The Boolean value to write (0 or 1).
An I/O error occurs.
The stream is closed.
1
Writes an unsigned byte to the current stream and advances the stream position by one byte.
The unsigned byte to write.
An I/O error occurs.
The stream is closed.
1
Writes a byte array to the underlying stream.
A byte array containing the data to write.
An I/O error occurs.
The stream is closed.
is null.
1
Writes a region of a byte array to the current stream.
A byte array containing the data to write.
The starting point in at which to begin writing.
The number of bytes to write.
The buffer length minus is less than .
is null.
or is negative.
An I/O error occurs.
The stream is closed.
1
Writes a Unicode character to the current stream and advances the current position of the stream in accordance with the Encoding used and the specific characters being written to the stream.
The non-surrogate, Unicode character to write.
An I/O error occurs.
The stream is closed.
is a single surrogate character.
1
Writes a character array to the current stream and advances the current position of the stream in accordance with the Encoding used and the specific characters being written to the stream.
A character array containing the data to write.
is null.
The stream is closed.
An I/O error occurs.
1
Writes a section of a character array to the current stream, and advances the current position of the stream in accordance with the Encoding used and perhaps the specific characters being written to the stream.
A character array containing the data to write.
The starting point in from which to begin writing.
The number of characters to write.
The buffer length minus is less than .
is null.
or is negative.
An I/O error occurs.
The stream is closed.
1
Writes a decimal value to the current stream and advances the stream position by sixteen bytes.
The decimal value to write.
An I/O error occurs.
The stream is closed.
1
Writes an eight-byte floating-point value to the current stream and advances the stream position by eight bytes.
The eight-byte floating-point value to write.
An I/O error occurs.
The stream is closed.
1
Writes a two-byte signed integer to the current stream and advances the stream position by two bytes.
The two-byte signed integer to write.
An I/O error occurs.
The stream is closed.
1
Writes a four-byte signed integer to the current stream and advances the stream position by four bytes.
The four-byte signed integer to write.
An I/O error occurs.
The stream is closed.
1
Writes an eight-byte signed integer to the current stream and advances the stream position by eight bytes.
The eight-byte signed integer to write.
An I/O error occurs.
The stream is closed.
1
Writes a signed byte to the current stream and advances the stream position by one byte.
The signed byte to write.
An I/O error occurs.
The stream is closed.
1
Writes a four-byte floating-point value to the current stream and advances the stream position by four bytes.
The four-byte floating-point value to write.
An I/O error occurs.
The stream is closed.
1
Writes a length-prefixed string to this stream in the current encoding of the , and advances the current position of the stream in accordance with the encoding used and the specific characters being written to the stream.
The value to write.
An I/O error occurs.
is null.
The stream is closed.
1
Writes a two-byte unsigned integer to the current stream and advances the stream position by two bytes.
The two-byte unsigned integer to write.
An I/O error occurs.
The stream is closed.
1
Writes a four-byte unsigned integer to the current stream and advances the stream position by four bytes.
The four-byte unsigned integer to write.
An I/O error occurs.
The stream is closed.
1
Writes an eight-byte unsigned integer to the current stream and advances the stream position by eight bytes.
The eight-byte unsigned integer to write.
An I/O error occurs.
The stream is closed.
1
Writes a 32-bit integer in a compressed format.
The 32-bit integer to be written.
The end of the stream is reached.
The stream is closed.
The stream is closed.
The exception that is thrown when reading is attempted past the end of a stream.
2
Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_ENDOFSTREAM.
Initializes a new instance of the class with its message string set to and its HRESULT set to COR_E_ENDOFSTREAM.
A string that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception.
A string that describes the error. The content of is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception.
The exception that is thrown when a data stream is in an invalid format.
Initializes a new instance of the class.
Initializes a new instance of the class with a specified error message.
The error message that explains the reason for the exception.
Initializes a new instance of the class with a reference to the inner exception that is the cause of this exception.
The error message that explains the reason for the exception.
The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception.
Creates a stream whose backing store is memory.To browse the .NET Framework source code for this type, see the Reference Source.
2
Initializes a new instance of the class with an expandable capacity initialized to zero.
Initializes a new non-resizable instance of the class based on the specified byte array.
The array of unsigned bytes from which to create the current stream.
is null.
Initializes a new non-resizable instance of the class based on the specified byte array with the property set as specified.
The array of unsigned bytes from which to create this stream.
The setting of the property, which determines whether the stream supports writing.
is null.
Initializes a new non-resizable instance of the class based on the specified region (index) of a byte array.
The array of unsigned bytes from which to create this stream.
The index into at which the stream begins.
The length of the stream in bytes.
is null.
or is less than zero.
The buffer length minus is less than .
Initializes a new non-resizable instance of the class based on the specified region of a byte array, with the property set as specified.
The array of unsigned bytes from which to create this stream.
The index in at which the stream begins.
The length of the stream in bytes.
The setting of the property, which determines whether the stream supports writing.
is null.
or are negative.
The buffer length minus is less than .
Initializes a new instance of the class based on the specified region of a byte array, with the property set as specified, and the ability to call set as specified.
The array of unsigned bytes from which to create this stream.
The index into at which the stream begins.
The length of the stream in bytes.
The setting of the property, which determines whether the stream supports writing.
true to enable , which returns the unsigned byte array from which the stream was created; otherwise, false.
is null.
or is negative.
The buffer length minus is less than .
Initializes a new instance of the class with an expandable capacity initialized as specified.
The initial size of the internal array in bytes.
is negative.
Gets a value indicating whether the current stream supports reading.
true if the stream is open.
2
Gets a value indicating whether the current stream supports seeking.
true if the stream is open.
2
Gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
2
Gets or sets the number of bytes allocated for this stream.
The length of the usable portion of the buffer for the stream.
A capacity is set that is negative or less than the current length of the stream.
The current stream is closed.
set is invoked on a stream whose capacity cannot be modified.
2
Asynchronously reads all the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.
A task that represents the asynchronous copy operation.
The stream to which the contents of the current stream will be copied.
The size, in bytes, of the buffer. This value must be greater than zero.
The token to monitor for cancellation requests.
is null.
is negative or zero.
Either the current stream or the destination stream is disposed.
The current stream does not support reading, or the destination stream does not support writing.
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.
Overrides the method so that no action is performed.
2
Asynchronously clears all buffers for this stream, and monitors cancellation requests.
A task that represents the asynchronous flush operation.
The token to monitor for cancellation requests.
The stream has been disposed.
Gets the length of the stream in bytes.
The length of the stream in bytes.
The stream is closed.
2
Gets or sets the current position within the stream.
The current position within the stream.
The position is set to a negative value or a value greater than .
The stream is closed.
2
Reads a block of bytes from the current stream and writes the data to a buffer.
The total number of bytes written into the buffer. This can be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.
When this method returns, contains the specified byte array with the values between and ( + - 1) replaced by the characters read from the current stream.
The zero-based byte offset in at which to begin storing data from the current stream.
The maximum number of bytes to read.
is null.
or is negative.
subtracted from the buffer length is less than .
The current stream instance is closed.
2
Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
The buffer to write the data into.
The byte offset in at which to begin writing data from the stream.
The maximum number of bytes to read.
The token to monitor for cancellation requests. The default value is .
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support reading.
The stream has been disposed.
The stream is currently in use by a previous read operation.
Reads a byte from the current stream.
The byte cast to a , or -1 if the end of the stream has been reached.
The current stream instance is closed.
2
Sets the position within the current stream to the specified value.
The new position within the stream, calculated by combining the initial reference point and the offset.
The new position within the stream. This is relative to the parameter, and can be positive or negative.
A value of type , which acts as the seek reference point.
Seeking is attempted before the beginning of the stream.
is greater than .
There is an invalid . -or- caused an arithmetic overflow.
The current stream instance is closed.
2
Sets the length of the current stream to the specified value.
The value at which to set the length.
The current stream is not resizable and is larger than the current capacity.-or- The current stream does not support writing.
is negative or is greater than the maximum length of the , where the maximum length is( - origin), and origin is the index into the underlying buffer at which the stream starts.
2
Writes the stream contents to a byte array, regardless of the property.
A new byte array.
2
Returns the array of unsigned bytes from which this stream was created. The return value indicates whether the conversion succeeded.
true if the conversion was successful; otherwise, false.
The byte array segment from which this stream was created.
Writes a block of bytes to the current stream using data read from a buffer.
The buffer to write data from.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The maximum number of bytes to write.
is null.
The stream does not support writing. For additional information see .-or- The current position is closer than bytes to the end of the stream, and the capacity cannot be modified.
subtracted from the buffer length is less than .
or are negative.
An I/O error occurs.
The current stream instance is closed.
2
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
A task that represents the asynchronous write operation.
The buffer to write data from.
The zero-based byte offset in from which to begin copying bytes to the stream.
The maximum number of bytes to write.
The token to monitor for cancellation requests. The default value is .
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support writing.
The stream has been disposed.
The stream is currently in use by a previous write operation.
Writes a byte to the current stream at the current position.
The byte to write.
The stream does not support writing. For additional information see .-or- The current position is at the end of the stream, and the capacity cannot be modified.
The current stream is closed.
2
Writes the entire contents of this memory stream to another stream.
The stream to write this memory stream to.
is null.
The current or target stream is closed.
2
Specifies the position in a stream to use for seeking.
2
Specifies the beginning of a stream.
Specifies the current position within a stream.
Specifies the end of a stream.
Provides a generic view of a sequence of bytes. This is an abstract class.To browse the .NET Framework source code for this type, see the Reference Source.
2
Initializes a new instance of the class.
When overridden in a derived class, gets a value indicating whether the current stream supports reading.
true if the stream supports reading; otherwise, false.
1
When overridden in a derived class, gets a value indicating whether the current stream supports seeking.
true if the stream supports seeking; otherwise, false.
1
Gets a value that determines whether the current stream can time out.
A value that determines whether the current stream can time out.
2
When overridden in a derived class, gets a value indicating whether the current stream supports writing.
true if the stream supports writing; otherwise, false.
1
Reads the bytes from the current stream and writes them to another stream.
The stream to which the contents of the current stream will be copied.
is null.
The current stream does not support reading.-or- does not support writing.
Either the current stream or were closed before the method was called.
An I/O error occurred.
Reads the bytes from the current stream and writes them to another stream, using a specified buffer size.
The stream to which the contents of the current stream will be copied.
The size of the buffer. This value must be greater than zero. The default size is 81920.
is null.
is negative or zero.
The current stream does not support reading.-or- does not support writing.
Either the current stream or were closed before the method was called.
An I/O error occurred.
Asynchronously reads the bytes from the current stream and writes them to another stream.
A task that represents the asynchronous copy operation.
The stream to which the contents of the current stream will be copied.
is null.
Either the current stream or the destination stream is disposed.
The current stream does not support reading, or the destination stream does not support writing.
Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size.
A task that represents the asynchronous copy operation.
The stream to which the contents of the current stream will be copied.
The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.
is null.
is negative or zero.
Either the current stream or the destination stream is disposed.
The current stream does not support reading, or the destination stream does not support writing.
Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token.
A task that represents the asynchronous copy operation.
The stream to which the contents of the current stream will be copied.
The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920.
The token to monitor for cancellation requests. The default value is .
is null.
is negative or zero.
Either the current stream or the destination stream is disposed.
The current stream does not support reading, or the destination stream does not support writing.
Releases all resources used by the .
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device.
An I/O error occurs.
2
Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device.
A task that represents the asynchronous flush operation.
The stream has been disposed.
Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests.
A task that represents the asynchronous flush operation.
The token to monitor for cancellation requests. The default value is .
The stream has been disposed.
When overridden in a derived class, gets the length in bytes of the stream.
A long value representing the length of the stream in bytes.
A class derived from Stream does not support seeking.
Methods were called after the stream was closed.
1
A Stream with no backing store.
1
When overridden in a derived class, gets or sets the position within the current stream.
The current position within the stream.
An I/O error occurs.
The stream does not support seeking.
Methods were called after the stream was closed.
1
When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.
An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source.
The zero-based byte offset in at which to begin storing the data read from the current stream.
The maximum number of bytes to be read from the current stream.
The sum of and is larger than the buffer length.
is null.
or is negative.
An I/O error occurs.
The stream does not support reading.
Methods were called after the stream was closed.
1
Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
The buffer to write the data into.
The byte offset in at which to begin writing data from the stream.
The maximum number of bytes to read.
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support reading.
The stream has been disposed.
The stream is currently in use by a previous read operation.
Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
The buffer to write the data into.
The byte offset in at which to begin writing data from the stream.
The maximum number of bytes to read.
The token to monitor for cancellation requests. The default value is .
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support reading.
The stream has been disposed.
The stream is currently in use by a previous read operation.
Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.
The unsigned byte cast to an Int32, or -1 if at the end of the stream.
The stream does not support reading.
Methods were called after the stream was closed.
2
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out.
A value, in miliseconds, that determines how long the stream will attempt to read before timing out.
The method always throws an .
2
When overridden in a derived class, sets the position within the current stream.
The new position within the current stream.
A byte offset relative to the parameter.
A value of type indicating the reference point used to obtain the new position.
An I/O error occurs.
The stream does not support seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
1
When overridden in a derived class, sets the length of the current stream.
The desired length of the current stream in bytes.
An I/O error occurs.
The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output.
Methods were called after the stream was closed.
2
When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
An array of bytes. This method copies bytes from to the current stream.
The zero-based byte offset in at which to begin copying bytes to the current stream.
The number of bytes to be written to the current stream.
The sum of and is greater than the buffer length.
is null.
or is negative.
An I/O error occured, such as the specified file cannot be found.
The stream does not support writing.
was called after the stream was closed.
1
Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.
A task that represents the asynchronous write operation.
The buffer to write data from.
The zero-based byte offset in from which to begin copying bytes to the stream.
The maximum number of bytes to write.
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support writing.
The stream has been disposed.
The stream is currently in use by a previous write operation.
Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests.
A task that represents the asynchronous write operation.
The buffer to write data from.
The zero-based byte offset in from which to begin copying bytes to the stream.
The maximum number of bytes to write.
The token to monitor for cancellation requests. The default value is .
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream does not support writing.
The stream has been disposed.
The stream is currently in use by a previous write operation.
Writes a byte to the current position in the stream and advances the position within the stream by one byte.
The byte to write to the stream.
An I/O error occurs.
The stream does not support writing, or the stream is already closed.
Methods were called after the stream was closed.
2
Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out.
A value, in miliseconds, that determines how long the stream will attempt to write before timing out.
The method always throws an .
2
Implements a that reads characters from a byte stream in a particular encoding.To browse the .NET Framework source code for this type, see the Reference Source.
1
Initializes a new instance of the class for the specified stream.
The stream to be read.
does not support reading.
is null.
Initializes a new instance of the class for the specified stream, with the specified byte order mark detection option.
The stream to be read.
Indicates whether to look for byte order marks at the beginning of the file.
does not support reading.
is null.
Initializes a new instance of the class for the specified stream, with the specified character encoding.
The stream to be read.
The character encoding to use.
does not support reading.
or is null.
Initializes a new instance of the class for the specified stream, with the specified character encoding and byte order mark detection option.
The stream to be read.
The character encoding to use.
Indicates whether to look for byte order marks at the beginning of the file.
does not support reading.
or is null.
Initializes a new instance of the class for the specified stream, with the specified character encoding, byte order mark detection option, and buffer size.
The stream to be read.
The character encoding to use.
Indicates whether to look for byte order marks at the beginning of the file.
The minimum buffer size.
The stream does not support reading.
or is null.
is less than or equal to zero.
Initializes a new instance of the class for the specified stream based on the specified character encoding, byte order mark detection option, and buffer size, and optionally leaves the stream open.
The stream to read.
The character encoding to use.
true to look for byte order marks at the beginning of the file; otherwise, false.
The minimum buffer size.
true to leave the stream open after the object is disposed; otherwise, false.
Returns the underlying stream.
The underlying stream.
2
Gets the current character encoding that the current object is using.
The current character encoding used by the current reader. The value can be different after the first call to any method of , since encoding autodetection is not done until the first call to a method.
2
Clears the internal buffer.
2
Closes the underlying stream, releases the unmanaged resources used by the , and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Gets a value that indicates whether the current stream position is at the end of the stream.
true if the current stream position is at the end of the stream; otherwise false.
The underlying stream has been disposed.
1
A object around an empty stream.
1
Returns the next available character but does not consume it.
An integer representing the next character to be read, or -1 if there are no characters to be read or if the stream does not support seeking.
An I/O error occurs.
1
Reads the next character from the input stream and advances the character position by one character.
The next character from the input stream represented as an object, or -1 if no more characters are available.
An I/O error occurs.
1
Reads a specified maximum of characters from the current stream into a buffer, beginning at the specified index.
The number of characters that have been read, or 0 if at the end of the stream and no data was read. The number will be less than or equal to the parameter, depending on whether the data is available within the stream.
When this method returns, contains the specified character array with the values between and () replaced by the characters read from the current source.
The index of at which to begin writing.
The maximum number of characters to read.
The buffer length minus is less than .
is null.
or is negative.
An I/O error occurs, such as the stream is closed.
1
Reads a specified maximum number of characters from the current stream asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written into the buffer, the current method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream has been disposed.
The reader is currently in use by a previous read operation.
Reads a specified maximum number of characters from the current stream and writes the data to a buffer, beginning at the specified index.
The number of characters that have been read. The number will be less than or equal to , depending on whether all input characters have been read.
When this method returns, contains the specified character array with the values between and () replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read.
is null.
The buffer length minus is less than .
or is negative.
The is closed.
An I/O error occurred.
Reads a specified maximum number of characters from the current stream asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written into the buffer, the method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The stream has been disposed.
The reader is currently in use by a previous read operation.
Reads a line of characters from the current stream and returns the data as a string.
The next line from the input stream, or null if the end of the input stream is reached.
There is insufficient memory to allocate a buffer for the returned string.
An I/O error occurs.
1
Reads a line of characters asynchronously from the current stream and returns the data as a string.
A task that represents the asynchronous read operation. The value of the parameter contains the next line from the stream, or is null if all the characters have been read.
The number of characters in the next line is larger than .
The stream has been disposed.
The reader is currently in use by a previous read operation.
Reads all characters from the current position to the end of the stream.
The rest of the stream as a string, from the current position to the end. If the current position is at the end of the stream, returns an empty string ("").
There is insufficient memory to allocate a buffer for the returned string.
An I/O error occurs.
1
Reads all characters from the current position to the end of the stream asynchronously and returns them as one string.
A task that represents the asynchronous read operation. The value of the parameter contains a string with the characters from the current position to the end of the stream.
The number of characters is larger than .
The stream has been disposed.
The reader is currently in use by a previous read operation.
Implements a for writing characters to a stream in a particular encoding.To browse the .NET Framework source code for this type, see the Reference Source.
1
Initializes a new instance of the class for the specified stream by using UTF-8 encoding and the default buffer size.
The stream to write to.
is not writable.
is null.
Initializes a new instance of the class for the specified stream by using the specified encoding and the default buffer size.
The stream to write to.
The character encoding to use.
or is null.
is not writable.
Initializes a new instance of the class for the specified stream by using the specified encoding and buffer size.
The stream to write to.
The character encoding to use.
The buffer size, in bytes.
or is null.
is negative.
is not writable.
Initializes a new instance of the class for the specified stream by using the specified encoding and buffer size, and optionally leaves the stream open.
The stream to write to.
The character encoding to use.
The buffer size, in bytes.
true to leave the stream open after the object is disposed; otherwise, false.
or is null.
is negative.
is not writable.
Gets or sets a value indicating whether the will flush its buffer to the underlying stream after every call to .
true to force to flush its buffer; otherwise, false.
1
Gets the underlying stream that interfaces with a backing store.
The stream this StreamWriter is writing to.
2
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
The current encoding does not support displaying half of a Unicode surrogate pair.
Gets the in which the output is written.
The specified in the constructor for the current instance, or if an encoding was not specified.
2
Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream.
The current writer is closed.
An I/O error has occurred.
The current encoding does not support displaying half of a Unicode surrogate pair.
1
Clears all buffers for this stream asynchronously and causes any buffered data to be written to the underlying device.
A task that represents the asynchronous flush operation.
The stream has been disposed.
Provides a StreamWriter with no backing store that can be written to, but not read from.
1
Writes a character to the stream.
The character to write to the stream.
An I/O error occurs.
is true or the buffer is full, and current writer is closed.
is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream.
1
Writes a character array to the stream.
A character array containing the data to write. If is null, nothing is written.
An I/O error occurs.
is true or the buffer is full, and current writer is closed.
is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream.
1
Writes a subarray of characters to the stream.
A character array that contains the data to write.
The character position in the buffer at which to start reading data.
The maximum number of characters to write.
is null.
The buffer length minus is less than .
or is negative.
An I/O error occurs.
is true or the buffer is full, and current writer is closed.
is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream.
1
Writes a string to the stream.
The string to write to the stream. If is null, nothing is written.
is true or the buffer is full, and current writer is closed.
is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream.
An I/O error occurs.
1
Writes a character to the stream asynchronously.
A task that represents the asynchronous write operation.
The character to write to the stream.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a subarray of characters to the stream asynchronously.
A task that represents the asynchronous write operation.
A character array that contains the data to write.
The character position in the buffer at which to begin reading data.
The maximum number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a string to the stream asynchronously.
A task that represents the asynchronous write operation.
The string to write to the stream. If is null, nothing is written.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a line terminator asynchronously to the stream.
A task that represents the asynchronous write operation.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a character followed by a line terminator asynchronously to the stream.
A task that represents the asynchronous write operation.
The character to write to the stream.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a subarray of characters followed by a line terminator asynchronously to the stream.
A task that represents the asynchronous write operation.
The character array to write data from.
The character position in the buffer at which to start reading data.
The maximum number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Writes a string followed by a line terminator asynchronously to the stream.
A task that represents the asynchronous write operation.
The string to write. If the value is null, only a line terminator is written.
The stream writer is disposed.
The stream writer is currently in use by a previous write operation.
Implements a that reads from a string.
2
Initializes a new instance of the class that reads from the specified string.
The string to which the should be initialized.
The parameter is null.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Returns the next available character but does not consume it.
An integer representing the next character to be read, or -1 if no more characters are available or the stream does not support seeking.
The current reader is closed.
2
Reads the next character from the input string and advances the character position by one character.
The next character from the underlying string, or -1 if no more characters are available.
The current reader is closed.
2
Reads a block of characters from the input string and advances the character position by .
The total number of characters read into the buffer. This can be less than the number of characters requested if that many characters are not currently available, or zero if the end of the underlying string has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The starting index in the buffer.
The number of characters to read.
is null.
The buffer length minus is less than .
or is negative.
The current reader is closed.
2
Reads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the string has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the string is reached before the specified number of characters is written into the buffer, the method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The string reader has been disposed.
The reader is currently in use by a previous read operation.
Reads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the string has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the string is reached before the specified number of characters is written into the buffer, the method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The string reader has been disposed.
The reader is currently in use by a previous read operation.
Reads a line of characters from the current string and returns the data as a string.
The next line from the current string, or null if the end of the string is reached.
The current reader is closed.
There is insufficient memory to allocate a buffer for the returned string.
2
Reads a line of characters asynchronously from the current string and returns the data as a string.
A task that represents the asynchronous read operation. The value of the parameter contains the next line from the string reader, or is null if all the characters have been read.
The number of characters in the next line is larger than .
The string reader has been disposed.
The reader is currently in use by a previous read operation.
Reads all characters from the current position to the end of the string and returns them as a single string.
The content from the current position to the end of the underlying string.
There is insufficient memory to allocate a buffer for the returned string.
The current reader is closed.
2
Reads all characters from the current position to the end of the string asynchronously and returns them as a single string.
A task that represents the asynchronous read operation. The value of the parameter contains a string with the characters from the current position to the end of the string.
The number of characters is larger than .
The string reader has been disposed.
The reader is currently in use by a previous read operation.
Implements a for writing information to a string. The information is stored in an underlying .
2
Initializes a new instance of the class.
Initializes a new instance of the class with the specified format control.
An object that controls formatting.
Initializes a new instance of the class that writes to the specified .
The StringBuilder to write to.
is null.
Initializes a new instance of the class that writes to the specified and has the specified format provider.
The StringBuilder to write to.
An object that controls formatting.
is null.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Gets the in which the output is written.
The Encoding in which the output is written.
1
Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
A task that represents the asynchronous flush operation.
Returns the underlying .
The underlying StringBuilder.
2
Returns a string containing the characters written to the current StringWriter so far.
The string containing the characters written to the current StringWriter.
2
Writes a character to the string.
The character to write.
The writer is closed.
2
Writes a subarray of characters to the string.
The character array to write data from.
The position in the buffer at which to start reading data.
The maximum number of characters to write.
is null.
or is negative.
( + )> . Length.
The writer is closed.
2
Writes a string to the current string.
The string to write.
The writer is closed.
2
Writes a character to the string asynchronously.
A task that represents the asynchronous write operation.
The character to write to the string.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Writes a subarray of characters to the string asynchronously.
A task that represents the asynchronous write operation.
The character array to write data from.
The position in the buffer at which to start reading data.
The maximum number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Writes a string to the current string asynchronously.
A task that represents the asynchronous write operation.
The string to write. If is null, nothing is written to the text stream.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Writes a character followed by a line terminator asynchronously to the string.
A task that represents the asynchronous write operation.
The character to write to the string.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Writes a subarray of characters followed by a line terminator asynchronously to the string.
A task that represents the asynchronous write operation.
The character array to write data from.
The position in the buffer at which to start reading data.
The maximum number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Writes a string followed by a line terminator asynchronously to the current string.
A task that represents the asynchronous write operation.
The string to write. If the value is null, only a line terminator is written.
The string writer is disposed.
The string writer is currently in use by a previous write operation.
Represents a reader that can read a sequential series of characters.
2
Initializes a new instance of the class.
Releases all resources used by the object.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Provides a TextReader with no data to read from.
1
Reads the next character without changing the state of the reader or the character source. Returns the next available character without actually reading it from the reader.
An integer representing the next character to be read, or -1 if no more characters are available or the reader does not support seeking.
The is closed.
An I/O error occurs.
1
Reads the next character from the text reader and advances the character position by one character.
The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1.
The is closed.
An I/O error occurs.
1
Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index.
The number of characters that have been read. The number will be less than or equal to , depending on whether the data is available within the reader. This method returns 0 (zero) if it is called when no more characters are left to read.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the reader is reached before the specified number of characters is read into the buffer, the method returns.
is null.
The buffer length minus is less than .
or is negative.
The is closed.
An I/O error occurs.
1
Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The text reader has been disposed.
The reader is currently in use by a previous read operation.
Reads a specified maximum number of characters from the current text reader and writes the data to a buffer, beginning at the specified index.
The number of characters that have been read. The number will be less than or equal to , depending on whether all input characters have been read.
When this method returns, this parameter contains the specified character array with the values between and ( + -1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read.
is null.
The buffer length minus is less than .
or is negative.
The is closed.
An I/O error occurs.
2
Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index.
A task that represents the asynchronous read operation. The value of the parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached.
When this method returns, contains the specified character array with the values between and ( + - 1) replaced by the characters read from the current source.
The position in at which to begin writing.
The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns.
is null.
or is negative.
The sum of and is larger than the buffer length.
The text reader has been disposed.
The reader is currently in use by a previous read operation.
Reads a line of characters from the text reader and returns the data as a string.
The next line from the reader, or null if all characters have been read.
An I/O error occurs.
There is insufficient memory to allocate a buffer for the returned string.
The is closed.
The number of characters in the next line is larger than
1
Reads a line of characters asynchronously and returns the data as a string.
A task that represents the asynchronous read operation. The value of the parameter contains the next line from the text reader, or is null if all of the characters have been read.
The number of characters in the next line is larger than .
The text reader has been disposed.
The reader is currently in use by a previous read operation.
Reads all characters from the current position to the end of the text reader and returns them as one string.
A string that contains all characters from the current position to the end of the text reader.
An I/O error occurs.
The is closed.
There is insufficient memory to allocate a buffer for the returned string.
The number of characters in the next line is larger than
1
Reads all characters from the current position to the end of the text reader asynchronously and returns them as one string.
A task that represents the asynchronous read operation. The value of the parameter contains a string with the characters from the current position to the end of the text reader.
The number of characters is larger than .
The text reader has been disposed.
The reader is currently in use by a previous read operation.
Represents a writer that can write a sequential series of characters. This class is abstract.
2
Initializes a new instance of the class.
Initializes a new instance of the class with the specified format provider.
An object that controls formatting.
Stores the newline characters used for this TextWriter.
Releases all resources used by the object.
Releases the unmanaged resources used by the and optionally releases the managed resources.
true to release both managed and unmanaged resources; false to release only unmanaged resources.
When overridden in a derived class, returns the character encoding in which the output is written.
The character encoding in which the output is written.
1
Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
1
Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
A task that represents the asynchronous flush operation.
The text writer is disposed.
The writer is currently in use by a previous write operation.
Gets an object that controls formatting.
An object for a specific culture, or the formatting of the current culture if no other culture is specified.
2
Gets or sets the line terminator string used by the current TextWriter.
The line terminator string for the current TextWriter.
2
Provides a TextWriter with no backing store that can be written to, but not read from.
1
Writes the text representation of a Boolean value to the text string or stream.
The Boolean value to write.
The is closed.
An I/O error occurs.
1
Writes a character to the text string or stream.
The character to write to the text stream.
The is closed.
An I/O error occurs.
1
Writes a character array to the text string or stream.
The character array to write to the text stream.
The is closed.
An I/O error occurs.
1
Writes a subarray of characters to the text string or stream.
The character array to write data from.
The character position in the buffer at which to start retrieving data.
The number of characters to write.
The buffer length minus is less than .
The parameter is null.
or is negative.
The is closed.
An I/O error occurs.
1
Writes the text representation of a decimal value to the text string or stream.
The decimal value to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an 8-byte floating-point value to the text string or stream.
The 8-byte floating-point value to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of a 4-byte signed integer to the text string or stream.
The 4-byte signed integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an 8-byte signed integer to the text string or stream.
The 8-byte signed integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an object to the text string or stream by calling the ToString method on that object.
The object to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of a 4-byte floating-point value to the text string or stream.
The 4-byte floating-point value to write.
The is closed.
An I/O error occurs.
1
Writes a string to the text string or stream.
The string to write.
The is closed.
An I/O error occurs.
1
Writes a formatted string to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
The object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one).
1
Writes a formatted string to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
The first object to format and write.
The second object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero) or greater than or equal to the number of objects to be formatted (which, for this method overload, is two).
1
Writes a formatted string to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
The first object to format and write.
The second object to format and write.
The third object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three).
1
Writes a formatted string to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
An object array that contains zero or more objects to format and write.
or is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the array.
1
Writes the text representation of a 4-byte unsigned integer to the text string or stream.
The 4-byte unsigned integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an 8-byte unsigned integer to the text string or stream.
The 8-byte unsigned integer to write.
The is closed.
An I/O error occurs.
1
Writes a character to the text string or stream asynchronously.
A task that represents the asynchronous write operation.
The character to write to the text stream.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a character array to the text string or stream asynchronously.
A task that represents the asynchronous write operation.
The character array to write to the text stream. If is null, nothing is written.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a subarray of characters to the text string or stream asynchronously.
A task that represents the asynchronous write operation.
The character array to write data from.
The character position in the buffer at which to start retrieving data.
The number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a string to the text string or stream asynchronously.
A task that represents the asynchronous write operation.
The string to write. If is null, nothing is written to the text stream.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a line terminator to the text string or stream.
The is closed.
An I/O error occurs.
1
Writes the text representation of a Boolean value followed by a line terminator to the text string or stream.
The Boolean value to write.
The is closed.
An I/O error occurs.
1
Writes a character followed by a line terminator to the text string or stream.
The character to write to the text stream.
The is closed.
An I/O error occurs.
1
Writes an array of characters followed by a line terminator to the text string or stream.
The character array from which data is read.
The is closed.
An I/O error occurs.
1
Writes a subarray of characters followed by a line terminator to the text string or stream.
The character array from which data is read.
The character position in at which to start reading data.
The maximum number of characters to write.
The buffer length minus is less than .
The parameter is null.
or is negative.
The is closed.
An I/O error occurs.
1
Writes the text representation of a decimal value followed by a line terminator to the text string or stream.
The decimal value to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of a 8-byte floating-point value followed by a line terminator to the text string or stream.
The 8-byte floating-point value to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of a 4-byte signed integer followed by a line terminator to the text string or stream.
The 4-byte signed integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an 8-byte signed integer followed by a line terminator to the text string or stream.
The 8-byte signed integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an object by calling the ToString method on that object, followed by a line terminator to the text string or stream.
The object to write. If is null, only the line terminator is written.
The is closed.
An I/O error occurs.
1
Writes the text representation of a 4-byte floating-point value followed by a line terminator to the text string or stream.
The 4-byte floating-point value to write.
The is closed.
An I/O error occurs.
1
Writes a string followed by a line terminator to the text string or stream.
The string to write. If is null, only the line terminator is written.
The is closed.
An I/O error occurs.
1
Writes a formatted string and a new line to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
The object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one).
1
Writes a formatted string and a new line to the text string or stream, using the same semantics as the method.
A composite format string (see Remarks).
The first object to format and write.
The second object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is two).
1
Writes out a formatted string and a new line, using the same semantics as .
A composite format string (see Remarks).
The first object to format and write.
The second object to format and write.
The third object to format and write.
is null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three).
1
Writes out a formatted string and a new line, using the same semantics as .
A composite format string (see Remarks).
An object array that contains zero or more objects to format and write.
A string or object is passed in as null.
The is closed.
An I/O error occurs.
is not a valid composite format string.-or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the array.
1
Writes the text representation of a 4-byte unsigned integer followed by a line terminator to the text string or stream.
The 4-byte unsigned integer to write.
The is closed.
An I/O error occurs.
1
Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the text string or stream.
The 8-byte unsigned integer to write.
The is closed.
An I/O error occurs.
1
Writes a line terminator asynchronously to the text string or stream.
A task that represents the asynchronous write operation.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a character followed by a line terminator asynchronously to the text string or stream.
A task that represents the asynchronous write operation.
The character to write to the text stream.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes an array of characters followed by a line terminator asynchronously to the text string or stream.
A task that represents the asynchronous write operation.
The character array to write to the text stream. If the character array is null, only the line terminator is written.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a subarray of characters followed by a line terminator asynchronously to the text string or stream.
A task that represents the asynchronous write operation.
The character array to write data from.
The character position in the buffer at which to start retrieving data.
The number of characters to write.
is null.
The plus is greater than the buffer length.
or is negative.
The text writer is disposed.
The text writer is currently in use by a previous write operation.
Writes a string followed by a line terminator asynchronously to the text string or stream.
A task that represents the asynchronous write operation.
The string to write. If the value is null, only a line terminator is written.
The text writer is disposed.
The text writer is currently in use by a previous write operation.