2016-01-25 18:05:55 -08:00

21 lines
602 B
Java

// serialization/xfiles/ThawAlien.java
// (c)2016 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://mindviewinc.com/Books/OnJava/ for more book information.
// Recover a serialized file
package serialization.xfiles;
import java.io.*;
public class ThawAlien {
public static void
main(String[] args) throws Exception {
ObjectInputStream in = new ObjectInputStream(
new FileInputStream(new File("..", "X.file")));
Object mystery = in.readObject();
System.out.println(mystery.getClass());
}
}
/* Output:
class Alien
*/