Javascript var and BinaryData?

I want to use evaluate but specifically return a var which is a MemoryBlock not a primitive. 


Is there an example for that anywhere?



I don't think any of the pure javascript stuff would be able to create a MemoryBlock var, but you could write a native class that returns one, and then pass it around using JS like any other variable, perhaps?

Ah. So make a var of the right kind ( var myMB (nullptr, 0); ??) and then pass it to the JavaScript engine? May as well make hooks to set strings and bytes at that point.

Is there any code to access a MemoryStream in JS then? A javascript alternative to a << stream concat?





You could certainly write some native extensions to JS that would provide that kind of function, but I don't think the lowest-level data structure that JS itself has is just an array of vars.