Java Object Serialize and Deserialize deSerializeObject(byte[] base64SerializedObject)

Here you can find the source of deSerializeObject(byte[] base64SerializedObject)

Description

de Serialize Object

License

Open Source License

Declaration

public static Serializable deSerializeObject(byte[] base64SerializedObject) 

Method Source Code

//package com.java2s;
/**//from  w  ww.  ja v a  2 s.  c o m
    
 * License: https://github.com/votingsystem/votingsystem/wiki/Licencia
 */

import java.io.*;
import java.util.Base64;

public class Main {
    public static Serializable deSerializeObject(byte[] base64SerializedObject) {
        Serializable deserializedObject = null;
        try {
            byte[] data = Base64.getDecoder().decode(base64SerializedObject);
            ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));
            deserializedObject = (Serializable) ois.readObject();
            ois.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return deserializedObject;
    }
}

Related

  1. deserialized(final byte[] data)
  2. deserializeFromString(String obj)
  3. deserializeGZip(byte[] buf, T obj)
  4. deserializeJdk(byte[] bytes)
  5. deSerializeObj(byte[] array)
  6. deserializeObject(String dir)
  7. deSerializeObject(String str, Class cls)
  8. deserializeObjectFromByteArray(byte[] data)
  9. deserializeObjectFromByteArray(byte[] theSerializedVersion)