Binary Node Path Syntax¶
A Binary message is an opaque byte blob used to ferry non-textual content (PDFs, images, encrypted payloads) through QIE without inspecting its internal structure. Because the message body has no parsed structure, Binary supports only the root node path (/); any other node path throws a MessageModelException with the text Invalid node path: '...'.
| Operation | Binary support |
|---|---|
getNode('/') |
Returns the entire message body as a String decoded using the message's configured encoding. |
checkNodeExists('/') |
Returns true when the message body is non-empty. |
Examples¶
Read the message body as a decoded string (uses the message's configured encoding):
Read the raw bytes:
Get the number of bytes:
Replace the message bytes:
In practice, the most common use of a Binary message is to write its content out to a file, either via a File Sender destination node, or from a custom script using qie.writeFile(). Because qie.writeFile() accepts a byte[] directly, the bytes returned by source.getBytes() can be written without any decoding step:
The third argument (true) creates any missing directories in the destination path.