- Memento
- 快照
- Java序列化, ProtoBuf库
-
class C implements Serializable { private transient List<Object> list; } ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(new File(""))); oos.writeObject(o1) oos.writeObject(o2) ObjectInputStream ois = new ObjectInputStream(new FileInputStream(new File(""))); o1 = ois.readObject(); o2 = ois.readObject();
-