- public
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); -
List dest = (List)in.readObject(); -
return dest; - }
List深度Copy-序列化
最新推荐文章于 2022-08-07 21:50:35 发布