NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MemoryStream Constructor (Byte[])

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[]
);

Parameters

buffer
The array of unsigned bytes from which to create the current stream.

Exceptions

Exception Type Condition
ArgumentNullException buffer is null.

Remarks

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.

See Also

MemoryStream Class | MemoryStream Members | System.IO Namespace | MemoryStream Constructor Overload List