The whole thread discussed that handcrafted FFDs are not supported and referred back to this 2012 posting on the options. It also listed the only Enhancement Request that has been done since 2007 for FFD processing (FFD PMRs were fixed of course).

Further below I will show how easily binary data processing can be done with GatewayScript (available with 7.0.0.0 firmware). But before lets summarize all DataPower Non-XML data processing options here in one place:

One comment on option 4. While this works without Dataglue license (these days a XG45 without DIM option) you have to "pay" the price in form of added latency and memory consumption of the attachment processing needed by that technique.

The simple GatewayScript data structure for processing binary data is the buffer object.

For reading binary input we use readAsBuffer() method, and its documentation tries to move people to use the Buffers object.

When contexts are small, use the readAsBuffer() function. Use the readAsBuffers() function when a context is large. The readAsBuffer() function requires a contiguous memory allocation. The readAsBuffer() function is faster but is more demanding on the memory system. The readAsBuffers() function does not require contiguous memory to populate the Buffers object.

Use of Buffers might be valid for some Non-XML processing, but when the application needs access to whole input I prefer buffer.

Good news is that the first (workable) Non-XML sample program can be found in readAsBuffer() documentation itself. It is a binary identity operation with error handling. Here you can see rAB.js:

Since binary identity is not that interesting lets see now the binary reverse operation from "... without Dataglue license" posting. Adding 5 lines to rAB.js does the job. here is reverse.js:

Now lets see what both do on sample input from "... without DataGlue license" posting:

Last question to be answered is on the runtime of rAB.js and reverse.js on the 10MB input. That can be answered easily based on the ExtLatency logging target of coproc2gatewayscript again blog posting:

...,AXF=137,AGS=908,......,AXF=134,AGS=147,...

So the reverse operation on 10MB data (read binary data, revert, output result to context) took (908-137)=771msec.