Here you can find the source of saveDate(String path, Object obj)
public static synchronized void saveDate(String path, Object obj)
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; public class Main { public static String DEF_DATA_DIR; public static synchronized void saveDate(String path, Object obj) { File file = new File(DEF_DATA_DIR + File.separator + path); try {/*from w w w . j a v a2s .c om*/ ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(file)); out.writeObject(obj); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } } }