VMware Aria Automation offers a byte buffer class, in the context of the JavaScript runtime environment. This is a wrapper around a byte array and used for passing references to binary content. To use the methods of the this class outside of Aria Automation, a library is available here to emulate it.
This mock-up of the byte buffer class bases on the same JavaScript engine used in Aria Automation, the
Mozilla Rhino engine. To use this file classes it is necessary to use the Rhino engine, because their constructor access Java classes directly. This ensures us a consistent basis for simulation and operation.
To use this library in your code it is necessary to add e.g.
load("bytebuffer.class.js");
at the beginning of the program. After that, all functions can be used seamlessly just like in Aria Automation.
You can download the source from
my GitHub account.