自动化立体仓库 - WMS系统
#
LSH
2023-10-23 5025bdb514ede86546854ce595005f9409e775f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.zy.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<Map> deepCopy(List<Map> 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();
        return dest;
    }
 
}