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 (Int32)

Initializes a new MemoryStream with an expandable capacity initially set as specified.

[Visual Basic]
Overloads Public Sub New( _
   ByVal capacity As Integer _
)
[C#]
public MemoryStream(
   int capacity
);
[C++]
public: MemoryStream(
   int capacity
);
[JScript]
public function MemoryStream(
   capacity : int
);

Parameters

capacity
The initial size of the internal array in bytes.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException capacity is negative.

Remarks

The CanRead, CanSeek, and CanWrite properties are all set to true.

The capacity is automatically increased when the SetLength method is used to set the length to a value larger than the capacity of the current stream.

This constructor exposes the underlying stream, which GetBuffer returns.

See Also

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