List of utility methods to do Object Save
boolean | writeObject(File f, Object obj) write Object boolean retObj = true; if (!f.getParentFile().isDirectory()) { f.getParentFile().mkdirs(); FileOutputStream fileOutputStream = null; ObjectOutputStream objectOutputStream = null; try { fileOutputStream = new FileOutputStream(f); ... |
void | writeObject(File f, Serializable obj) Serializes an object to a file, masking out annoying exceptions. try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f)); oos.writeObject(obj); oos.close(); } catch (IOException e) { System.err.println("Exception writing file " + f + ": " + e); |
void | writeObject(File file, Object obj) Write one object to the specified file. createFileIfNotExist(file); ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)); oos.writeObject(obj); oos.close(); |
void | writeObject(File file, Object object) writes the spcified object to the file specified mkdirs(file); ObjectOutputStream output = null; try { output = new ObjectOutputStream(new FileOutputStream(file)); output.writeObject(object); } finally { close(output, file); |
void | writeObject(File file, Object object) write Object try { FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(object); out.close(); fileOut.close(); } catch (IOException e) { e.printStackTrace(); ... |
void | writeObject(File file, Object object) write Object mkdirs(file.getParentFile()); OutputStream outputStream = null; try { outputStream = new FileOutputStream(file); @SuppressWarnings("resource") ObjectOutputStream oos = new ObjectOutputStream(outputStream); oos.writeObject(object); oos.flush(); ... |
void | writeObject(File file, Object object) write Object try (ObjectOutputStream outputStream = new ObjectOutputStream(new FileOutputStream(file))) { outputStream.writeObject(object); outputStream.flush(); } catch (IOException e) { throw new RuntimeException(e); |
void | writeObject(File file, Object object) write Object ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)); oos.writeObject(object); oos.flush(); oos.close(); |
void | writeObject(File outFile, Object data) write Object FileOutputStream fileOut = new FileOutputStream(outFile); ObjectOutputStream outStream = new ObjectOutputStream(fileOut); try { outStream.writeObject(data); } finally { outStream.close(); fileOut.close(); |
void | writeObject(Object data, String filename) write Object File file = new File(filename); if (!file.exists()) { file.getParentFile().mkdirs(); file.createNewFile(); FileOutputStream fileOut = new FileOutputStream(file); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(data); ... |