Java ObjectOutputStream Write saveAllPlaying(Object obj, String path)

Here you can find the source of saveAllPlaying(Object obj, String path)

Description

Used for saving the ParkourSessions.

License

Open Source License

Parameter

Parameter Description
obj a parameter
path a parameter

Declaration

public static void saveAllPlaying(Object obj, String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.io.FileOutputStream;

import java.io.ObjectOutputStream;

public class Main {
    /**/*  w ww  .  j  a  v a2s  . co m*/
     * Used for saving the ParkourSessions.
     * Thanks to Tomsik68 for this code.
     *
     * @param obj
     * @param path
     */
    public static void saveAllPlaying(Object obj, String path) {
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(path));
            oos.writeObject(obj);
            oos.flush();
            oos.close();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}

Related

  1. save(File f, T o)
  2. save(Object o)
  3. save(Object obj, String path)
  4. save(Serializable serialized, String filepath)
  5. save(String name, Serializable object)
  6. saveBinary(File dumpFile, Object object)
  7. saveCompressed(String filename, Object o)
  8. saveData(HashMap data, String filename)
  9. saveData(Object data, String filename)