From 995622ebc7f2884747d3380641ed621641c5a77b Mon Sep 17 00:00:00 2001 From: Matt Rendina Date: Thu, 30 Nov 2017 11:52:55 -0500 Subject: Put it back --- vars/utils.groovy | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vars/utils.groovy') 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() +} -- cgit