Here you can find the source of deserialize(InputStream in)
Parameter | Description |
---|---|
in | Where to read serialized object from |
Parameter | Description |
---|---|
IOException | Reading from input stream |
ClassNotFoundException | Should not be thrown as only casting to Object |
public static Object deserialize(InputStream in) throws IOException, ClassNotFoundException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; public class Main { /**//from w ww.ja v a 2s. c o m * Deserialize from input stream * * @param in * Where to read serialized object from * @return Deserialized object * @throws IOException * Reading from input stream * @throws ClassNotFoundException * Should not be thrown as only casting to Object */ public static Object deserialize(InputStream in) throws IOException, ClassNotFoundException { ObjectInputStream is = new ObjectInputStream(in); return is.readObject(); } }