java 对象序列化

ArrayList<String> objlst = new ArrayList<String>();
			 FileOutputStream fos = new FileOutputStream(root +"lst.out");
		     ObjectOutputStream oos = new ObjectOutputStream(fos);  
		     oos.writeObject(objlst);
			 
		     FileInputStream fis = new FileInputStream(root + "lst.out");
		     ObjectInputStream ois = new ObjectInputStream(fis);		     
		     ArrayList<String> lst = (ArrayList<String>) ois.readObject();

你可能感兴趣的:(java 对象序列化)