BinaryStream.Constructor(mb as MemoryBlock)

From Xojo Documentation

Constructor
BinaryStream.Constructor(mb as MemoryBlock)

Creates a BinaryStream from a MemoryBlock.

Notes

All BinaryStream functions are supported. If the MemoryBlock was created from a Declare, then the Length property of the BinaryStream will always report -1.

A BinaryStream created using a MemoryBlock will automatically re-size the MemoryBlock as needed to contain any additional data written to the stream.

Sample Code

Dim mb As New MemoryBlock(100)
Dim b As New BinaryStream(mb)
b.Write("Hello")
b.Close