The methods of the Stream class are listed below. For a complete list of Stream class members, see the Stream Members topic.
BeginRead | Begins an asynchronous read. |
BeginWrite | Begins an asynchronous write. |
Close | Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. |
EndRead | Ends a pending asynchronous read request. |
EndWrite | Ends an asynchronous write. |
Equals (inherited from Object) | Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality). |
Flush | Updates the underlying data source or repository with the current state of the buffer and then clears the buffer.
If a stream does not implement a buffer, this method will do nothing. |
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. |
GetType (inherited from Object) | Gets the Type of the Object. |
Read | Reads a sequence of bytes from the current stream and advances the current position within the stream by the number of bytes read. |
ReadByte | Reads a byte from the current position in the stream, or-1 if at the end of the stream. |
Seek | Sets the position within the current stream. |
SetLength | Sets the length of the current stream. |
ToString (inherited from Object) | Returns a String that represents the current Object. |
Write | Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. |
WriteByte | Writes a byte to the current position in the stream.
If the stream is closed or not writable, an exception will be thrown. |
CreateWaitHandle | Allocates a WaitHandle object efficiently. |
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere. |
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object. |