qie.createBinaryMessage¶
Signature: qie.createBinaryMessage(value*, encoding*)
Returns: Binary Message message - the newly created message object
Replace the current message with an empty Binary message.
Note
The return value MUST ALWAYS be assigned to the bound-in message object.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String or byte[] | value* | (optional) the initial message value as a string or byte array | null |
| String | encoding* | (optional) the character encoding for this message | Source Node encoding |
Example¶
// createBinaryMessage Examples:
// Example: value as String
message = qie.createBinaryMessage(
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/wQAAwAB/ocL1QAAAABJRU5ErkJggg==",
"UTF-8"
);
// Example: value as byte[]
var binaryBytes = [
72,101,108,108,111,32,66,105,110,97,114,121
]; // "Hello Binary"
message = qie.createBinaryMessage(
binaryBytes,
"UTF-8"
);
// Example: no value provided
message = qie.createBinaryMessage();