从文件反序列化对象
import java.awt.Color; import java.awt.image.BufferedImage; /* 来 自* N o w J a v a . c o m - 时 代 Java */ import java.io.*; import java.util.ArrayList; import java.util.logging.*; public class Main{ /** * Deserialize an object from file * @param filename The filename of the serialized object * @return The deserialized object */ public static Object deserialize(String filename) { System.out.println("Deserializing " + filename); Object object = null; try {// 来 自 n o w j a v a . c o m - 时 代 Java FileInputStream fileIn = new FileInputStream(filename); ObjectInputStream in = new ObjectInputStream(fileIn); object = in.readObject(); in.close(); fileIn.close(); } catch (IOException i) { Logger.getLogger(HelperFunctions.class.getName()).log( Level.SEVERE, null, i); } catch (ClassNotFoundException c) { Logger.getLogger(