diff options
| author | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 11:52:55 -0500 |
|---|---|---|
| committer | Matt Rendina <mrendina@stsci.edu> | 2017-11-30 11:52:55 -0500 |
| commit | 995622ebc7f2884747d3380641ed621641c5a77b (patch) | |
| tree | b7934f641f6e03344bda4b64c295b00b6eac68cf /vars/utils.groovy | |
| parent | cfe264b76d2aaa6cde2a3ffffc1a60341cc218e2 (diff) | |
| download | jscu_refactor-995622ebc7f2884747d3380641ed621641c5a77b.tar.gz | |
Put it back
Diffstat (limited to 'vars/utils.groovy')
| -rw-r--r-- | vars/utils.groovy | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vars/utils.groovy b/vars/utils.groovy index fe76bca..60b76c9 100644 --- a/vars/utils.groovy +++ b/vars/utils.groovy @@ -99,3 +99,14 @@ def concurrent(configs) { parallel(tasks) } } //end concurrent + + +// standard deep copy implementation +def deepcopy(orig) { + bos = new ByteArrayOutputStream() + oos = new ObjectOutputStream(bos) + oos.writeObject(orig); oos.flush() + bin = new ByteArrayInputStream(bos.toByteArray()) + ois = new ObjectInputStream(bin) + return ois.readObject() +} |
