- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
40 lines
1.4 KiB
Java
40 lines
1.4 KiB
Java
package com.mbridge.msdk.foundation.tools;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.ObjectInputStream;
|
|
import java.io.ObjectOutputStream;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public final class al {
|
|
public static String a(Object obj) {
|
|
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
try {
|
|
ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream);
|
|
objectOutputStream.writeObject(obj);
|
|
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
|
objectOutputStream.flush();
|
|
objectOutputStream.close();
|
|
return new String(byteArray, "ISO-8859-1");
|
|
} catch (IOException e) {
|
|
af.b("SerializeTools", "IOException", e);
|
|
return "";
|
|
}
|
|
}
|
|
|
|
public static Object a(String str) {
|
|
try {
|
|
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(str.getBytes("ISO-8859-1"));
|
|
ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream);
|
|
Object readObject = objectInputStream.readObject();
|
|
objectInputStream.close();
|
|
byteArrayInputStream.close();
|
|
return readObject;
|
|
} catch (Exception e) {
|
|
af.b("SerializeTools", "Exception", e);
|
|
return null;
|
|
}
|
|
}
|
|
}
|