xojo.core.memoryblock to sqlite blob

At present, I have this:

Dim blobPtr as SQLiteBlob, body as memoryblock // Initialise body here blobPtr.Write (body)

and this works OK.

Now, I want to change the declaration of body to xojo.core.memoryblock - it’s actually passed in as a parameter to the function where I’m writing the blob. In fact it might even need to be a xojo.core.mutablememoryblock.

How can I get at the bytes within the xojo.core.memoryblock to make a string to pass to blobPtr.write without copying them? I’m trying to reduce the number of times I am having to copy data back and forth because xojo.core.memoryblock is missing methods that the old framework has.

Not tested as I am not in front of a computer right know:

Dim body As XojoCore.MemoryBlock ... Dim s As String = CType(body.Data, MemoryBlock).StringValue(0, body.Size)

Well the IDE doesn’t complain, so that’s a start. I’ll take a look tomorrow at what that should do, it’s pumpkin time here.