strings, streams and memoryblocks.

I need memory blocks because i handle huge streams of binary data where the Endianism is not a constant.
These binary data chucks come from files or from sockets.

Socket readAll returns a string
I use that string to construct a binaryStream

My internal structures use memory block as their base class.

I’m concerened with the transfer of memory between these structures

dim str as string
Dim mb as memoryblock(n)
dim bs as new BinaryStream(str)

mb = str

When constructing these objects is a memcpy being performed?
Can this be done by reference?

if I remember correctly, the BinaryStream constructor references the memoryblock. So no copy

you can easily test it by modifying the memoryblock after the constructor and before a read.