Here you can find the source of fromStringSafe(final String s)
public static Object fromStringSafe(final String s)
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import javax.xml.bind.DatatypeConverter; public class Main { public static Object fromStringSafe(final String s) { try {//from www . j a v a 2 s . c om return fromString(s); } catch (final Exception e) { e.printStackTrace(); return null; } } /** Read the object from Base64 string. */ public static Object fromString(final String s) throws IOException, ClassNotFoundException { if (null == s) { return null; } final byte[] data = DatatypeConverter.parseBase64Binary(s); final ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data)); final Object o = ois.readObject(); ois.close(); return o; } }