BCL 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 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.MarshalByRefObject System.IDisposable

Abstract base class for all stream implementations.

Streams involve three fundamental operations:

You can read from streams. Reading is the transfer of data from a stream into a data structure, such as an array of bytes.

You can write to streams. Writing is the transfer of data from a data structure into a stream.

Streams can support seeking. Seeking is the querying and modifying of the current position within a stream. Seek capability depends on the kind of backing store a stream has. For example, network streams have no unified concept of a current position, and therefore typically do not support seeking.

All classes that represent streams inherit from the class. The class and its subclasses provide a generic view of data sources and repositories, isolating the programmer from the specific details of the operating system and underlying devices.

Subclasses are required to provide implementations only for the synchronous read and write methods. The asynchronous read and write methods are implemented via the synchronous ones. The synchronous read and write methods are and . The asynchronous read and write methods are , , , and .

Depending on the underlying data source or repository, streams might support only some of these capabilities. An application can query a stream for its capabilities by using the , , and properties.

The and methods read and write data in a variety of formats. For streams that support seeking, the and methods, and the and properties can be used to query and modify the current position and length of a stream.

Some stream implementations perform local buffering of the underlying data to improve performance. For such streams, the method can be used to clear any internal buffers and ensure that all data has been written to the underlying data source or repository.

Calling on a flushes any buffered data, essentially calling for you. also releases operating system resources such as file handles, network connections, or memory used for any internal buffering.

If you need a with no backing store (i.e., a bit bucket), use .

- Constructor
  Constructs a new instance of the class.
  To be added.
  0
  1.0.5000.0
  2.0.0.0
- Method
  System.IAsyncResult `` `` `` `` `` The array to read the data into. A that specifies the byte offset in at which to begin writing data read from the stream. A that specifies the maximum number of bytes to read from the stream. A delegate to be called when the read is complete, or . An application-defined object, or .

  Begins an asynchronous read operation.

  A that contains information about the asynchronous read operation, which could still be pending.

  This method starts an asynchronous read operation. To determine how many bytes were read and release resources allocated by this method, call the method and specify the object returned by this method. The method should be called exactly once for each call to .

  If the parameter is not , the method referenced by is invoked when the asynchronous operation completes. The object returned by this method is passed as the argument to the method referenced by .

  The current position in the stream is updated when the asynchronous read or write is issued, not when the I/O operation completes.

  Multiple simultaneous asynchronous requests render the request completion order unspecified.

  The parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the property of the object returned by this method.

  Use the property to determine whether the current instance supports reading.

  As described above.

  An I/O error occurred. The current does not support reading. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Method
  System.IAsyncResult `` `` `` `` `` The array to be written to the current stream. A that specifies the byte offset in at which to begin copying bytes to the current stream. A that specifies the maximum number of bytes to be written to the current stream. A delegate to be called when the write is complete, or . An application-defined object, or .

  Begins an asynchronous write operation.

  A that represents the asynchronous write, which could still be pending.

  Pass the returned by this method to to ensure that the write completes and frees resources appropriately. If an error occurs during an asynchronous write, an exception will not be thrown until is called with the returned by this method. If a failure is detected from the underlying OS (such as if a floppy is ejected in the middle of the operation), the results of the write operation are undefined.

  If the parameter is not , the method referenced by is invoked when the asynchronous operation completes. The object returned by this method is passed as the argument to the method referenced by .

  The parameter can be any object that the caller wishes to have available for the duration of the asynchronous operation. This object is available via the property of the object returned by this method.

  If a stream is writable, writing at the end of it expands the stream.

  The current position in the stream is updated when you issue the asynchronous read or write, not when the I/O operation completes. Multiple simultaneous asynchronous requests render the request completion order uncertain.

  should generally be greater than 64 KB.

  Use the property to determine whether the current instance supports writing.

  As described above.

  The current does not support writing. An I/O error occurred. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Property
  System.Boolean

  Gets a value indicating whether the current stream supports reading.

  if the stream supports reading; otherwise, .

  If a class derived from does not support reading, the following methods throw a : , and .

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean

  Gets a value indicating whether the current stream supports seeking.

  if the stream supports seeking; otherwise, .

  If a class derived from does not support seeking, the following methods throw a : , , , or .

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Boolean To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0
- Property
  System.Boolean

  Gets a value indicating whether the current stream supports writing.

  if the stream supports writing; otherwise, .

  If a class derived from does not support writing, the following methods throw a : , , and .

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Void

  Closes the current stream and releases any resources associated with the current stream.

  Following a call to this method, a call to another operation on the same stream might result in an exception (such as , for example). However, if the stream is already closed, a call to throws no exceptions.

  If this method is called while an asynchronous read or write is pending for a stream, the behavior of the stream is undefined.

  As described above.

  0
  1.0.5000.0
  2.0.0.0
- Method
  System.Threading.WaitHandle

  Allocates a object.

  A reference to the allocated .

  When called for the first time this method creates a object and returns it. On subsequent calls, the method returns a reference to the same wait handle.

  is useful if you implement the asynchronous methods and require a way of blocking in or until the asynchronous operation is complete.

  0
  1.0.5000.0
  2.0.0.0
  System.Obsolete("CreateWaitHandle is due for removal. Use "new ManualResetEvent(false)" instead.")
- Method
  System.Void To be added. To be added. 2.0.0.0
- Method
  System.Void `` To be added. To be added. To be added. 2.0.0.0
- Method
  System.Int32 `` The object that references the pending asynchronous read request.

  Ends a pending asynchronous read request.

  A that indicates the number of bytes read from the stream, between 0 and the number of bytes specified via the parameter . Streams only return 0 at the end of the stream, otherwise, they block until at least 1 byte is available.

  blocks until the I/O operation has completed.

  As described above.

  is . did not originate from a method on the current stream. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` A that references the outstanding asynchronous I/O request.

  Ends an asynchronous write operation.

  is required to be called exactly once for every . blocks until the write I/O operation has completed.

  As described above.

  The parameter is . did not originate from a method on the current stream. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void

  Flushes the internal buffer.

  Implementers should use this method to move any information from an underlying buffer to its destination. The method should clear the buffer, but the stream should not be closed. Depending upon the state of the object, the current position within the stream might need to be modified (for example, if the underlying stream supports seeking). For additional information see .

  As described above.

  Override on streams that implement a buffer.

  An I/O error occurs. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Property
  System.Int64

  Gets the length in bytes of the stream.

  A value representing the length of the stream in bytes.

  Use the property to determine whether the current instance supports seeking.

  This property is read-only.

  The stream does not support seeking. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Field
  System.IO.Stream

  Returns a with no backing store.

  is used to redirect output to a stream that does not consume any operating system resources. When the methods of that provide writing are invoked on , they simply return, and no data is written. also implements a method that returns zero without reading data.

  0
  1.0.5000.0
  2.0.0.0
- Property
  System.Int64

  Gets or sets the position within the current stream.

  A that specifies the current position within the stream.

  The stream is required to support seeking to get or set the position. Use the property to determine whether the current instance supports seeking.

  Classes that derive from are required to provide an implementation of this property.

  As described above.

  An I/O error has occurred. The stream does not support seeking. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Method
  System.Int32 `` `` `` A array. When this method returns, the elements between and are replaced by the bytes read from the current source. A that specifies the zero based byte offset in at which to begin storing the data read from the current stream. A that specifies the maximum number of bytes to be read from the current stream.

  Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

  A that specifies the total number of bytes read into the buffer, or zero if the end of the stream has been reached before any data can be read.

  Use the property to determine whether the current instance supports reading.

  As described above.

  ( + - 1) is greater than the length of . is . or is less than zero. An I/O error occurred. The current stream does not support reading. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Method
  System.Int32

  Reads a byte from the stream and advances the position within the stream by one byte.

  The unsigned byte cast to a , or -1 if at the end of the stream.

  As described above.

  Use the property to determine whether the current instance supports reading.

  An I/O error has occurred. The stream does not support reading. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0
- Method
  System.Int64 `` `` A that specifies the byte offset relative to origin. A value indicating the reference point used to obtain the new position.

  Changes the position within the current stream by the given offset, which is relative to the stated origin.

  A that specifies the new position within the current stream.

  Use the property to determine whether the current instance supports seeking.

  If is negative, the new position is required to precede the position specified by by the number of bytes specified by . If is zero, the new position is required to be the position specified by . If is positive, the new position is required to follow the position specified by by the number of bytes specified by .

  Classes derived from that support seeking are required to override this method.

  The stream does not support seeking, such as if the stream is constructed from a pipe or console output. The stream is closed. An I/O error has occurred. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` A that specifies the desired length of the current stream in bytes.

  Sets the length of the current stream.

  Use the property to determine whether the current instance supports writing, and the property to determine whether seeking is supported.

  If the specified value is less than the current length of the stream, the stream is truncated. If the specified value is larger than the current length of the stream, the stream is expanded. If the stream is expanded, the contents of the stream between the old and the new length are initialized to zeros.

  There is no default implementation.

  Classes derived from are required to support both writing and seeking for to work.

  The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. The stream is closed. An I/O error occurred. 0 1.0.5000.0 2.0.0.0
- Method
  System.IO.Stream `` To be added. To be added. To be added. To be added. 2.0.0.0
- Method
  System.Void Implemented to support the interface. [Note: For more information, see .] To be added. 1.0.5000.0
- Method
  System.Void `` `` `` A array containing the data to write. A that specifies the zero based byte offset in at which to begin copying bytes to the current stream. A that specifies the number of bytes to be written to the current stream.

  Writes a sequence of bytes to the current stream and advances the current position within the current stream by the number of bytes written.

  Use the property to determine whether the current instance supports writing.

  If the write operation is successful, the position within the stream advances by the number of bytes written. If an exception occurs, the position within the stream remains unchanged.

  ( + ) is greater than the length of . is . or is negative. An I/O error occurred. The stream does not support writing. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Method
  System.Void `` The to write to the stream.

  Writes a to the current position in the stream and advances the position within the stream by one byte.

  Use the property to determine whether the current instance supports writing.

  As described above.

  An I/O error has occurred. The stream does not support writing. The stream is closed. 0 1.0.5000.0 2.0.0.0
- Property
  System.Int32 To be added. To be added. To be added. System.Runtime.InteropServices.ComVisible(false) 2.0.0.0
0 System.Runtime.InteropServices.ComVisible(true)