plaidshirt
2 years agoContributor
Base64 decode a binary content with Groovy script
I use following script to decode a Base64 coded binary content and put it into a string then write to file.
byte[] decoded = slurper.signatureValue.decodeBase64(); String sigValue = new String(decoded) def path = context.expand('${Properties#outDir}') + context.expand('${Properties#fileName}') def myFile = new File(path) myFile.write(sigValue)
When I use Notepad++ with MIME tools plugin to decode it and save it, output is different and not sure, what is difference caused by.