Constructors: NewMemoryStream |
Initializes a new instance of the MemoryStream class based on the specified region of a byte array, with the CanWrite property set as specified.
Public Function NewMemoryStream( ByRef Buffer ( ) As Byte, Optional ByRef Index As Variant, Optional ByRef Count As Variant, Optional ByVal Writable As Boolean = True, Optional ByVal Mode As BufferMode = ShareMode ) As MemoryStream
Default: True
Default: ShareMode
The CanRead and CanSeek properties are both set to True. Capacity is set to Count.
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).
Exception | Condition |
---|---|
ArgumentNullException | Buffer is uninitialized. |
ArgumentOutOfRangeException | Index or Count are negative. |
ArgumentException | The buffer length minus Index is less than Count. |