List of utility methods to do ObjectOutputStream Write
void | saveObject(Object object, File file) Saves a raw Object to a file. if (!file.exists()) { file.getParentFile().mkdirs(); final ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file)); oos.writeObject(object); oos.close(); |
void | saveObject(Object object, String filename) Stores a Serializable Object. saveObject(object, new FileOutputStream(filename));
|
void | saveObject(Object object, String filename) Save Object - save 'object' into file 'filename'. FileOutputStream fout = new FileOutputStream(filename); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(object); oos.flush(); oos.close(); |
void | saveObject(Object saveObject, File path) Saves an Object to a file (can only be used on serializable Objects) ObjectOutputStream o = new ObjectOutputStream(new FileOutputStream(path, false)); o.writeObject(saveObject); o.close(); |
void | saveObject(Serializable obj, String url) Saves an Serializable Object to the hard disk. try { FileOutputStream fOut = new FileOutputStream(url); ObjectOutputStream objOut = new ObjectOutputStream(fOut); objOut.writeObject(obj); } catch (Exception e) { System.err.println(e.getMessage()); |
void | saveObject(String filename, Object obj) save Object FileOutputStream fos = new FileOutputStream(filename); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(obj); oos.flush(); oos.close(); fos.close(); |
boolean | saveObject(String filename, Object obj) save Object try { FileOutputStream fileOut = new FileOutputStream(filename); ObjectOutputStream out = new ObjectOutputStream(fileOut); out.writeObject(obj); out.close(); fileOut.close(); return true; } catch (FileNotFoundException e) { ... |
void | saveObject(String filePath, Serializable obj) save Object FileOutputStream fos = null; ObjectOutputStream out = null; try { fos = new FileOutputStream(filePath); out = new ObjectOutputStream(fos); out.writeObject(obj); out.close(); } catch (IOException ex) { ... |
void | saveObject(T object, File file, boolean use_compression) save Object OutputStream stream; FileOutputStream fout = new FileOutputStream(file); if (use_compression) { stream = new GZIPOutputStream(fout); } else { stream = fout; ObjectOutputStream fstream = new ObjectOutputStream(stream); ... |
void | saveObject2File(final Serializable object, final File file) save Object File try { saveObject2FileImpl(object, file); } catch (final Exception _exception) { throw new RuntimeException( "Problems saving object [" + object + "] to file [" + file + "]: " + _exception.getMessage(), _exception); |