parent
fb82de6182
commit
4784ea4f25
@ -1,32 +1,36 @@
|
||||
package cn.jyjz.xiaoyao.common.base.util;
|
||||
|
||||
|
||||
import com.sun.xml.messaging.saaj.util.ByteOutputStream;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.Map;
|
||||
|
||||
public class ObjectUtils {
|
||||
public class ObjectUtils extends org.springframework.util.ObjectUtils {
|
||||
|
||||
public static boolean isNotEmpty(Object obj) {
|
||||
return !isEmpty(obj);
|
||||
}
|
||||
|
||||
public static Object clone(Map obj){
|
||||
public static Object clone(Map obj) {
|
||||
Object cloneObj = null;
|
||||
ByteOutputStream bos = new ByteOutputStream();
|
||||
|
||||
|
||||
try {
|
||||
ObjectOutputStream oss = new ObjectOutputStream(bos);
|
||||
oss.writeObject(obj);
|
||||
oss.close();
|
||||
|
||||
|
||||
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
|
||||
ObjectInputStream ois = new ObjectInputStream(bis);
|
||||
cloneObj = ois.readObject();
|
||||
ois.close();
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
|
||||
return cloneObj;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue