Here you can find the source of deserialize(byte[] bytes)
public static Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.util.Base64; public class Main { public static Object deserialize(byte[] bytes) throws IOException, ClassNotFoundException { // byte[] bytes = Base64.getDecoder().decode(data); ByteArrayInputStream in = new ByteArrayInputStream(bytes); ObjectInputStream is = new ObjectInputStream(in); return is.readObject(); }/*from w ww .ja v a 2s .co m*/ public static Object deserialize(String data) throws IOException, ClassNotFoundException { byte[] bytes = Base64.getDecoder().decode(data); ByteArrayInputStream in = new ByteArrayInputStream(bytes); ObjectInputStream is = new ObjectInputStream(in); return is.readObject(); } }