Here you can find the source of saveObject(Object saveObject, File path)
Saves an Object to a file (can only be used on serializable Objects)
Parameter | Description |
---|---|
saveObject | Object to save |
path | Path to save the Object to |
Parameter | Description |
---|---|
IOException | an exception |
public static void saveObject(Object saveObject, File path) throws IOException
//package com.java2s; //License from project: LGPL import java.io.*; public class Main { /**/*w w w. j a va 2s.c om*/ * <p>Saves an Object to a file (can only be used on serializable Objects)</p> * @param saveObject Object to save * @param path Path to save the Object to * @throws IOException */ //Saves an Object to a file public static void saveObject(Object saveObject, File path) throws IOException { ObjectOutputStream o = new ObjectOutputStream(new FileOutputStream(path, false)); o.writeObject(saveObject); o.close(); } }