@Test public void deserialize() { Long l = Util.deserialize("rO0ABXNyAA5qYXZhLmxhbmcuTG9uZzuL5JDMjyPfAgABSgAFdmFsdWV4cgAQamF2YS5sYW5nLk51bWJlcoaslR0LlOCLAgAAeHAAAAAAAAAAew==", Long.class); assertEquals(Long.valueOf(123), l); }
public static <T> T deserialize(String s, Class<T> clazz) { ObjectInputStream in; try { byte[] data = Base64.decodeBase64(s); in = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = in.readObject(); return clazz.cast(o); } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } }
Util { public static <T> T deserialize(String s, Class<T> clazz) { ObjectInputStream in; try { byte[] data = Base64.decodeBase64(s); in = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = in.readObject(); return clazz.cast(o); } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }
Util { public static <T> T deserialize(String s, Class<T> clazz) { ObjectInputStream in; try { byte[] data = Base64.decodeBase64(s); in = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = in.readObject(); return clazz.cast(o); } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } private  Util(); }
Util { public static <T> T deserialize(String s, Class<T> clazz) { ObjectInputStream in; try { byte[] data = Base64.decodeBase64(s); in = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = in.readObject(); return clazz.cast(o); } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } private  Util(); static String toRealPagePath(String pagePath); static String toUrlPagePath(String pagePath); static String simplifyForUrl(String text); static String join(Object o, String delimiter); static void deleteQuietly(File f); static RuntimeException toRuntimeException(Throwable t); static File toFile(File baseDir, String path); static void closeQuietly(Closeable c); static Map<String, String> parseParameters(String params); static String serialize(Serializable s); static T deserialize(String s, Class<T> clazz); }
Util { public static <T> T deserialize(String s, Class<T> clazz) { ObjectInputStream in; try { byte[] data = Base64.decodeBase64(s); in = new ObjectInputStream(new ByteArrayInputStream(data)); Object o = in.readObject(); return clazz.cast(o); } catch (IOException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } private  Util(); static String toRealPagePath(String pagePath); static String toUrlPagePath(String pagePath); static String simplifyForUrl(String text); static String join(Object o, String delimiter); static void deleteQuietly(File f); static RuntimeException toRuntimeException(Throwable t); static File toFile(File baseDir, String path); static void closeQuietly(Closeable c); static Map<String, String> parseParameters(String params); static String serialize(Serializable s); static T deserialize(String s, Class<T> clazz);  }