List of utility methods to do ObjectOutputStream Write
void | save(File f, T o) save ObjectOutputStream writer = null; try { writer = new ObjectOutputStream(new FileOutputStream(f)); writer.writeObject(o); } catch (IOException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); ... |
byte[] | save(Object o) Serializes the object to a byte array. ByteArrayOutputStream baos = new ByteArrayOutputStream(); save(o, baos); return baos.toByteArray(); |
void | save(Object obj, String path) save File f = new File(path); FileOutputStream fos = new FileOutputStream(f); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fos); objectOutputStream.writeObject(obj); objectOutputStream.close(); |
void | save(Serializable serialized, String filepath) save save(serialized, new File(filepath));
|
boolean | save(String name, Serializable object) Save the given object into memory under a File called by the given name.dat. try { OutputStream file = new FileOutputStream(getFile(name)); OutputStream buffer = new BufferedOutputStream(file); try (ObjectOutput output = new ObjectOutputStream(buffer)) { output.writeObject(object); return true; } catch (IOException ignored) { ... |
void | saveAllPlaying(Object obj, String path) Used for saving the ParkourSessions. try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(path)); oos.writeObject(obj); oos.flush(); oos.close(); } catch (Exception ex) { ex.printStackTrace(); |
void | saveBinary(File dumpFile, Object object) save Binary try { ObjectOutputStream objStream = new ObjectOutputStream(new FileOutputStream(dumpFile)); objStream.writeObject(object); objStream.close(); } catch (IOException e) { throw new RuntimeException(e); |
void | saveCompressed(String filename, Object o) save Compressed saveCompressed(new File(filename), o);
|
void | saveData(HashMap data, String filename) save Data try { writeObject(data, filename); } catch (IOException e) { e.printStackTrace(); |
boolean | saveData(Object data, String filename) save Data try { FileOutputStream fo = new FileOutputStream(filename); ObjectOutputStream oo = new ObjectOutputStream(fo); oo.writeObject(data); oo.close(); fo.close(); } catch (Exception e) { return false; ... |