| | |
| | | */ |
| | | public class ListUtils { |
| | | |
| | | public static List<Map> deepCopy(List<Map> src) throws IOException, ClassNotFoundException { |
| | | public static List<Map<String, Object>> deepCopy(List<Map<String, Object>> 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<Map> dest = (List<Map>) in.readObject(); |
| | | List<Map<String, Object>> dest = (List<Map<String, Object>>) in.readObject(); |
| | | return dest; |
| | | } |
| | | |