Constructors: NewMemoryStream

NewMemoryStream

Returns a new memoryStream object which uses a supplied byte array.



 Public Function NewMemoryStream(
	  ByRef Buffer ( ) As Byte,
	  Optional ByVal Index As Variant,
	  Optional ByVal Count As Variant,
	  Optional ByVal Writable As Boolean = True ) As MemoryStream

Parameters

Buffer
[ByRef] Byte. The supplied byte array to act upon.
Index
[ByVal] Optional. Variant. The starting index in the array to begin usage.
Count
[ByVal] Optional. Variant. The total bytes that can be used by the stream.
Writable
[ByVal] Optional. Boolean. Whether or not to allow the stream to be written to.  

Default: True

Return Values

MemoryStream -  The newly created MemoryStream containing the supplied byte buffer.

Remarks

By using a user supplied buffer, the user can decide how much of the buffer is actually accessable. The buffer cannot be increased in size. The stream does not release the byte Buffer. The user still must maintain a reference to the array and keep it alive for the duration of the MemoryStreams life.

See Also

Project VBCorLib Overview Class Constructors Overview Constructors Properties Constructors Methods NewMemoryMappedFile NewNotSupportedException