Skip to content

Instantly share code, notes, and snippets.

Created April 13, 2014 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/9afadc3573c092119715 to your computer and use it in GitHub Desktop.
Save anonymous/9afadc3573c092119715 to your computer and use it in GitHub Desktop.
public void saveObject(File f, T o) throws NotSerializableException
{
ObjectOutputStream out = null;
try {
out = new ObjectOutputStream(new BufferedOutputStream(
new FileOutputStream(f)));
out.writeObject(t);
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment