Initializes a new MemoryStream based on the specified byte array with the CanWrite property set as specified.
[Visual Basic] Overloads Public Sub New( _ ByVal buffer() As Byte, _ ByVal writeable As Boolean _ ) [C#] public MemoryStream( byte[] buffer, bool writeable ); [C++] public: MemoryStream( unsigned char* buffer[], bool writeable ); [JScript] public function MemoryStream( buffer : Byte[], writeable : Boolean );
Exception Type | Condition |
---|---|
ArgumentNullException | buffer is null. |
The CanRead and CanSeek properties are both set to true.
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