Forum Discussion

plaidshirt's avatar
2 years ago

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)

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.

No RepliesBe the first to reply