Java Object Save writeObject(Object o, File path)

Here you can find the source of writeObject(Object o, File path)

Description

write Object

License

Open Source License

Declaration

public static void writeObject(Object o, File path) 

Method Source Code


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

import java.io.File;

import java.io.FileOutputStream;

import java.io.ObjectOutputStream;

public class Main {
    public static void writeObject(Object o, File path) {
        try {//ww w. j a va 2  s .  com
            ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(path));
            try {
                out.writeObject(o);
            } finally {
                out.close();
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}

Related

  1. writeObject(File file, Object object)
  2. writeObject(File outFile, Object data)
  3. writeObject(Object data, String filename)
  4. writeObject(Object i)
  5. writeObject(Object o, File f)
  6. writeObject(Object o, ObjectOutput dos)
  7. writeObject(Object obj, File path)
  8. writeObject(Object obj, ObjectOutput out)
  9. writeObject(Object object)