Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Description

The below is a couple of quick methods for zipping and unziping java String values.  Optionally (with true as the second param) the method 'chunks' the resulting  base64 encoded zipped string. Chunking just means long lines are broken at a specific column (line feeds inserted) to make the encoded data more easy to manage (think SSH keys). 

Code

Paste the below into a file "zipString.groovy" and run:

Calling the script

and now for the code:

Script Code

Executing the script gives the following output: 

 

Author: Matias Bjarland, Iteego Inc

  • No labels