Initializes a new MemoryStream based on the specified byte array.
[Visual Basic] Overloads Public Sub New( _ ByVal buffer() As Byte _ ) [C#] public MemoryStream( byte[] buffer ); [C++] public: MemoryStream( unsigned char* buffer[] ); [JScript] public function MemoryStream( buffer : Byte[] );
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is null. |
The CanRead, CanSeek, and CanWrite properties are all set to true. The new stream can be written to but is not resizable.
The length of the stream cannot be set to a value greater than the initial length of the specified byte array; however, the stream can be truncated (see SetLength).
This constructor does not expose the underlying stream. GetBuffer throws AccessException.
MemoryStream Class | MemoryStream Members | System.IO Namespace | MemoryStream Constructor Overload List