Here you can find the source of deserialize(InputStream is)
public static <T extends Serializable> T deserialize(InputStream is) throws IOException, ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.Serializable; public class Main { public static <T extends Serializable> T deserialize(InputStream is) throws IOException, ClassNotFoundException { ObjectInputStream in = new ObjectInputStream(is); @SuppressWarnings("unchecked") T e = (T) in.readObject();//from w w w .j ava2 s .c o m in.close(); return e; } }