MemoryStream Members
.NET Framework 2.0
Creates a stream whose backing store is memory.
The following tables list the members exposed by the MemoryStream type.
| Name | Description | |
|---|---|---|
| CanRead | Overridden. Gets a value indicating whether the current stream supports reading. |
| CanSeek | Overridden. Gets a value indicating whether the current stream supports seeking. |
| CanTimeout | Gets a value that determines whether the current stream can time out.(Inherited from Stream.) |
| CanWrite | Overridden. Gets a value indicating whether the current stream supports writing. |
| Capacity | Gets or sets the number of bytes allocated for this stream. |
| Length | Overridden. Gets the length of the stream in bytes. |
| Position | Overridden. Gets or sets the current position within the stream. |
| ReadTimeout | Gets or sets a value that determines how long the stream will attempt to read before timing out. (Inherited from Stream.) |
| WriteTimeout | Gets or sets a value that determines how long the stream will attempt to write before timing out. (Inherited from Stream.) |
(see also
Protected Methods
)
Top
| Name | Description | |
|---|---|---|
| BeginRead | Begins an asynchronous read operation. (Inherited from Stream.) |
| BeginWrite | Begins an asynchronous write operation. (Inherited from Stream.) |
| Close | Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. (Inherited from Stream.) |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) |
| Dispose | Overloaded. |
| EndRead | Waits for the pending asynchronous read to complete. (Inherited from Stream.) |
| EndWrite | Ends an asynchronous write operation. (Inherited from Stream.) |
| Equals | Overloaded. Determines whether two Object instances are equal. (Inherited from Object.) |
| Flush | Overridden. Overrides Stream.Flush so that no action is performed. |
| GetBuffer | Returns the array of unsigned bytes from which this stream was created. |
| GetHashCode | Serves as a hash function for a particular type. GetHashCode is suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object.) |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
| GetType | Gets the Type of the current instance. (Inherited from Object.) |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
| Read | Overridden. Reads a block of bytes from the current stream and writes the data to buffer. |
| ReadByte | Overridden. Reads a byte from the current stream. |
| ReferenceEquals | Determines whether the specified Object instances are the same instance. (Inherited from Object.) |
| Seek | Overridden. Sets the position within the current stream to the specified value. |
| SetLength | Overridden. Sets the length of the current stream to the specified value. |
| Synchronized | Creates a thread-safe (synchronized) wrapper around the specified Stream object. (Inherited from Stream.) |
| ToArray | Writes the stream contents to a byte array, regardless of the Position property. |
| ToString | Returns a String that represents the current Object. (Inherited from Object.) |
| Write | Overridden. Writes a block of bytes to the current stream using data read from buffer. |
| WriteByte | Overridden. Writes a byte to the current stream at the current position. |
| WriteTo | Writes the entire contents of this memory stream to another stream. |
| Name | Description | |
|---|---|---|
| CreateWaitHandle | Allocates a WaitHandle object. (Inherited from Stream.) |
| Dispose | Overloaded. Overridden. |
| Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) |
| MemberwiseClone | Overloaded. (Inherited from MarshalByRefObject.) |
Reference
MemoryStream ClassSystem.IO Namespace
Other Resources
File and Stream I/OHow to: Read Text from a File
How to: Write Text to a File