From ede0acb1de3f4a637c27083dac47b4dcdc594003 Mon Sep 17 00:00:00 2001 From: zu Date: Wed, 29 Nov 2023 05:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chwl/app/ui/utils/ArrayUtils.java | 50 ------------------- .../java/com/chwl/core/utils/ArrayUtils.java | 50 ------------------- 2 files changed, 100 deletions(-) delete mode 100644 app/src/main/java/com/chwl/app/ui/utils/ArrayUtils.java delete mode 100644 core/src/main/java/com/chwl/core/utils/ArrayUtils.java diff --git a/app/src/main/java/com/chwl/app/ui/utils/ArrayUtils.java b/app/src/main/java/com/chwl/app/ui/utils/ArrayUtils.java deleted file mode 100644 index 6fa5b1ac8..000000000 --- a/app/src/main/java/com/chwl/app/ui/utils/ArrayUtils.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.chwl.app.ui.utils; - -import com.chwl.library.utils.log.MLog; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -/** - * Created by zhouxiangfeng on 2017/6/14. - */ - -public class ArrayUtils { - - private static final String TAG = "ArrayUtils"; - - public static List deepCopy(List src) { - List dest = null; - try { - ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); - ObjectOutputStream out = null; - out = new ObjectOutputStream(byteOut); - out.writeObject(src); - - ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray()); - ObjectInputStream in = new ObjectInputStream(byteIn); - dest = (List) in.readObject(); - } catch (IOException e) { - e.printStackTrace(); - MLog.error(TAG,"deep copy io exception!"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - MLog.error(TAG,"deep copy classNotFoundException!"); - } - return dest; - } - - public static boolean replace(List mListData, T newT, T t) { - if (mListData.contains(t)) { - int position = mListData.indexOf(t); - mListData.set(position, newT); - return true; - } else { - return false; - } - } -} diff --git a/core/src/main/java/com/chwl/core/utils/ArrayUtils.java b/core/src/main/java/com/chwl/core/utils/ArrayUtils.java deleted file mode 100644 index 1222bbf35..000000000 --- a/core/src/main/java/com/chwl/core/utils/ArrayUtils.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.chwl.core.utils; - -import com.chwl.library.utils.log.MLog; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.util.List; - -/** - * Created by zhouxiangfeng on 2017/6/14. - */ - -public class ArrayUtils { - - private static final String TAG = "ArrayUtils"; - - public static List deepCopy(List src) { - List dest = null; - try { - ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); - ObjectOutputStream out = null; - out = new ObjectOutputStream(byteOut); - out.writeObject(src); - - ByteArrayInputStream byteIn = new ByteArrayInputStream(byteOut.toByteArray()); - ObjectInputStream in = new ObjectInputStream(byteIn); - dest = (List) in.readObject(); - } catch (IOException e) { - e.printStackTrace(); - MLog.error(TAG,"deep copy io exception!"); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - MLog.error(TAG,"deep copy classNotFoundException!"); - } - return dest; - } - - public static boolean replace(List mListData, T newT, T t) { - if (mListData.contains(t)) { - int position = mListData.indexOf(t); - mListData.set(position, newT); - return true; - } else { - return false; - } - } -}