Android byte[]转为对象

来源:互联网 发布:暗影精灵3 新机优化 编辑:程序博客网 时间:2024/06/05 22:31

Android byte[]转为对象

public static Object byteToObject(byte[] bytes) throws Exception {    ObjectInputStream ois = null;    try {        ois = new ObjectInputStream(new ByteArrayInputStream(bytes));        return ois.readObject();    } finally {        if (ois != null) ois.close();    }}
1 0
原创粉丝点击