Share via


MemoryStream Members

The following tables list the members exposed by the MemoryStream type.

Public Constructors

Name Description
Public Method MemoryStream Initializes a new non-resizable instance of the MemoryStream class based on the specified byte array.

Public Properties

Name Description
Public Property CanRead Gets a value indicating whether the current stream supports reading.
Public Property CanSeek Gets a value indicating whether the current stream supports seeking.
Public Property CanWrite Gets a value indicating whether the current stream supports writing.
Public Property Length Gets the length of the stream in bytes.
Public Property Position Gets or sets the current position within the stream.

Public Methods

Name Description
Public Method Dispose Releases the unmanaged resources used by the MemoryStream class and optionally releases the managed resources.
Public Method Flush Overrides Stream.Flush so that no action is performed.
Public Method Read Reads a block of bytes from the current stream and writes the data to buffer.
Public Method ReadByte Reads a byte from the current stream.
Public Method Seek Sets the position within the current stream to the specified value.
Public Method SetLength Sets the length of the current stream to the specified value.
Public Method ToArray Writes the stream contents to a byte array, regardless of the Position property.
Public Method Write Writes a block of bytes to the current stream using data read from buffer.
Public Method WriteByte Writes a byte to the current stream at the current position.
Public Method WriteTo Writes the entire contents of this memory stream to another stream.

See Also

Reference

MemoryStream Class
System.IO Namespace