package zy.cloud.wms.common.utils; import java.io.*; import java.util.List; import java.util.Map; /** * Created by vincent on 2020/10/17 */ public class ListUtils { public static List deepCopy(List src) throws IOException, ClassNotFoundException { ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(byteOut); out.writeObject(src); ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray()); ObjectInputStream in = new ObjectInputStream(byteIn); @SuppressWarnings("unchecked") List dest = (List) in.readObject(); return dest; } }