Java Object Save writeObject(File file, Object object)

Here you can find the source of writeObject(File file, Object object)

Description

write Object

License

Apache License

Declaration

public static void writeObject(File file, Object object) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

import java.io.FileOutputStream;

import java.io.ObjectOutputStream;

public class Main {

    public static void writeObject(String filename, Object object) throws Exception {
        writeObject(new File(filename), object);
    }//from www .j  a  v  a 2s.  c  om

    public static void writeObject(File file, Object object) throws Exception {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
        oos.writeObject(object);
        oos.flush();
        oos.close();
    }
}

Related

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