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 );
Exception Type | Condition |
---|---|
ArgumentOutOfRangeException | capacity is negative. |
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.
MemoryStream Class | MemoryStream Members | System.IO Namespace | MemoryStream Constructor Overload List