Forum Discussion
The intention of the multipart writer was to merge the individual binary output and write the zip file
- tstack7 years agoFormer Employee
Instead of doing a split, you’ll want to decode the base64 strings with Base64.decodeAsBinary() to turn them into byte arrays. You can then combine them using the
Uint8Array.concat()method (which is not documented at the moment, we’ll get that fixed). Theconcat()method will concatenate byte arrays and return a new byte array. The following expression puts it all together:Uint8Array.of().concat(...$[‘soap:Body’].Stream_LatestPackageResponse.Stream_LatestPackageResult.File.Chunk.map(Base64.decodeAsBinary))Note: the
concat()is a method on an existing byte array, so the above expression first creates an empty byte array withUint8Array.of()so that we can pass all of the byte arrays using the spread operator (...).Here’s a pipeline that demonstrates this stuff:
concat-bits_2019_12_02.slp (5.6 KB)
The MultipartWriter snap is for writing a MIME Multipart message, which is not what you are looking for here.