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.Capacity

Gets or sets the number of bytes allocated for this stream.

[Visual Basic]
Public Property Capacity As Integer
[C#]
public int Capacity {get; set;}
[C++]
public: __property int get_Capacity();
public: __property void set_Capacity(int);
[JScript]
public function get Capacity() : int;
public function set Capacity(int);

Property Value

The length of the usable portion of the buffer for the stream.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException A capacity is set that is negative or less than the current length of the stream.
NotSupportedException Set is invoked on a stream that is closed or whose capacity cannot be modified.

Remarks

Capacity is the buffer length for system-provided byte arrays. Capacity cannot be set to a value less than the current length of the stream.

See Also

MemoryStream Class | MemoryStream Members | System.IO Namespace